yangys
2024-03-27 e48aa2ac8dea1be5db11c63edf0b912c4ad5ce65
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
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
package com.qianwen.smartman.modules.cps.entity;
 
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;
import com.qianwen.smartman.common.constant.CommonConstant;
import com.qianwen.smartman.common.constant.DncConstant;
import com.qianwen.core.tool.utils.Func;
 
@ApiModel(value = "CommonGroup", description = "CommonGroup对象")
@TableName("blade_common_group")
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/entity/CommonGroup.class */
public class CommonGroup implements Serializable {
    private static final long serialVersionUID = 1;
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    private String tenantId;
    private Long parentId;
    private String extendId;
    private String fullName;
    private String code;
    private String name;
    private String groupType;
    private Integer groupCategory;
    @TableField(value = "group_tag", updateStrategy = FieldStrategy.IGNORED)
    private String groupTag;
    private Integer sort;
    private String remark;
    @TableLogic
    private Integer isDeleted;
    private Integer status;
 
    public void setId(final Long id) {
        this.id = id;
    }
 
    public void setTenantId(final String tenantId) {
        this.tenantId = tenantId;
    }
 
    public void setParentId(final Long parentId) {
        this.parentId = parentId;
    }
 
    public void setExtendId(final String extendId) {
        this.extendId = extendId;
    }
 
    public void setFullName(final String fullName) {
        this.fullName = fullName;
    }
 
    public void setCode(final String code) {
        this.code = code;
    }
 
    public void setName(final String name) {
        this.name = name;
    }
 
    public void setGroupType(final String groupType) {
        this.groupType = groupType;
    }
 
    public void setGroupCategory(final Integer groupCategory) {
        this.groupCategory = groupCategory;
    }
 
    public void setGroupTag(final String groupTag) {
        this.groupTag = groupTag;
    }
 
    public void setSort(final Integer sort) {
        this.sort = sort;
    }
 
    public void setRemark(final String remark) {
        this.remark = remark;
    }
 
    public void setIsDeleted(final Integer isDeleted) {
        this.isDeleted = isDeleted;
    }
 
    public void setStatus(final Integer status) {
        this.status = status;
    }
 
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (o instanceof CommonGroup) {
            CommonGroup other = (CommonGroup) o;
            if (other.canEqual(this)) {
                Object this$id = getId();
                Object other$id = other.getId();
                if (this$id == null) {
                    if (other$id != null) {
                        return false;
                    }
                } else if (!this$id.equals(other$id)) {
                    return false;
                }
                Object this$parentId = getParentId();
                Object other$parentId = other.getParentId();
                if (this$parentId == null) {
                    if (other$parentId != null) {
                        return false;
                    }
                } else if (!this$parentId.equals(other$parentId)) {
                    return false;
                }
                Object this$groupCategory = getGroupCategory();
                Object other$groupCategory = other.getGroupCategory();
                if (this$groupCategory == null) {
                    if (other$groupCategory != null) {
                        return false;
                    }
                } else if (!this$groupCategory.equals(other$groupCategory)) {
                    return false;
                }
                Object this$sort = getSort();
                Object other$sort = other.getSort();
                if (this$sort == null) {
                    if (other$sort != null) {
                        return false;
                    }
                } else if (!this$sort.equals(other$sort)) {
                    return false;
                }
                Object this$isDeleted = getIsDeleted();
                Object other$isDeleted = other.getIsDeleted();
                if (this$isDeleted == null) {
                    if (other$isDeleted != null) {
                        return false;
                    }
                } else if (!this$isDeleted.equals(other$isDeleted)) {
                    return false;
                }
                Object this$status = getStatus();
                Object other$status = other.getStatus();
                if (this$status == null) {
                    if (other$status != null) {
                        return false;
                    }
                } else if (!this$status.equals(other$status)) {
                    return false;
                }
                Object this$tenantId = getTenantId();
                Object other$tenantId = other.getTenantId();
                if (this$tenantId == null) {
                    if (other$tenantId != null) {
                        return false;
                    }
                } else if (!this$tenantId.equals(other$tenantId)) {
                    return false;
                }
                Object this$extendId = getExtendId();
                Object other$extendId = other.getExtendId();
                if (this$extendId == null) {
                    if (other$extendId != null) {
                        return false;
                    }
                } else if (!this$extendId.equals(other$extendId)) {
                    return false;
                }
                Object this$fullName = getFullName();
                Object other$fullName = other.getFullName();
                if (this$fullName == null) {
                    if (other$fullName != null) {
                        return false;
                    }
                } else if (!this$fullName.equals(other$fullName)) {
                    return false;
                }
                Object this$code = getCode();
                Object other$code = other.getCode();
                if (this$code == null) {
                    if (other$code != null) {
                        return false;
                    }
                } else if (!this$code.equals(other$code)) {
                    return false;
                }
                Object this$name = getName();
                Object other$name = other.getName();
                if (this$name == null) {
                    if (other$name != null) {
                        return false;
                    }
                } else if (!this$name.equals(other$name)) {
                    return false;
                }
                Object this$groupType = getGroupType();
                Object other$groupType = other.getGroupType();
                if (this$groupType == null) {
                    if (other$groupType != null) {
                        return false;
                    }
                } else if (!this$groupType.equals(other$groupType)) {
                    return false;
                }
                Object this$groupTag = getGroupTag();
                Object other$groupTag = other.getGroupTag();
                if (this$groupTag == null) {
                    if (other$groupTag != null) {
                        return false;
                    }
                } else if (!this$groupTag.equals(other$groupTag)) {
                    return false;
                }
                Object this$remark = getRemark();
                Object other$remark = other.getRemark();
                return this$remark == null ? other$remark == null : this$remark.equals(other$remark);
            }
            return false;
        }
        return false;
    }
 
    protected boolean canEqual(final Object other) {
        return other instanceof CommonGroup;
    }
 
    public int hashCode() {
        Object $id = getId();
        int result = (1 * 59) + ($id == null ? 43 : $id.hashCode());
        Object $parentId = getParentId();
        int result2 = (result * 59) + ($parentId == null ? 43 : $parentId.hashCode());
        Object $groupCategory = getGroupCategory();
        int result3 = (result2 * 59) + ($groupCategory == null ? 43 : $groupCategory.hashCode());
        Object $sort = getSort();
        int result4 = (result3 * 59) + ($sort == null ? 43 : $sort.hashCode());
        Object $isDeleted = getIsDeleted();
        int result5 = (result4 * 59) + ($isDeleted == null ? 43 : $isDeleted.hashCode());
        Object $status = getStatus();
        int result6 = (result5 * 59) + ($status == null ? 43 : $status.hashCode());
        Object $tenantId = getTenantId();
        int result7 = (result6 * 59) + ($tenantId == null ? 43 : $tenantId.hashCode());
        Object $extendId = getExtendId();
        int result8 = (result7 * 59) + ($extendId == null ? 43 : $extendId.hashCode());
        Object $fullName = getFullName();
        int result9 = (result8 * 59) + ($fullName == null ? 43 : $fullName.hashCode());
        Object $code = getCode();
        int result10 = (result9 * 59) + ($code == null ? 43 : $code.hashCode());
        Object $name = getName();
        int result11 = (result10 * 59) + ($name == null ? 43 : $name.hashCode());
        Object $groupType = getGroupType();
        int result12 = (result11 * 59) + ($groupType == null ? 43 : $groupType.hashCode());
        Object $groupTag = getGroupTag();
        int result13 = (result12 * 59) + ($groupTag == null ? 43 : $groupTag.hashCode());
        Object $remark = getRemark();
        return (result13 * 59) + ($remark == null ? 43 : $remark.hashCode());
    }
 
    public String toString() {
        return "CommonGroup(id=" + getId() + ", tenantId=" + getTenantId() + ", parentId=" + getParentId() + ", extendId=" + getExtendId() + ", fullName=" + getFullName() + ", code=" + getCode() + ", name=" + getName() + ", groupType=" + getGroupType() + ", groupCategory=" + getGroupCategory() + ", groupTag=" + getGroupTag() + ", sort=" + getSort() + ", remark=" + getRemark() + ", isDeleted=" + getIsDeleted() + ", status=" + getStatus() + ")";
    }
 
    /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/entity/CommonGroup$CommonGroupBuilder.class */
    public static class CommonGroupBuilder {
        private Long id;
        private String tenantId;
        private Long parentId;
        private String extendId;
        private String fullName;
        private String code;
        private String name;
        private String groupType;
        private Integer groupCategory;
        private String groupTag;
        private Integer sort;
        private String remark;
        private Integer isDeleted;
        private Integer status;
 
        CommonGroupBuilder() {
        }
 
        public CommonGroupBuilder id(final Long id) {
            this.id = id;
            return this;
        }
 
        public CommonGroupBuilder tenantId(final String tenantId) {
            this.tenantId = tenantId;
            return this;
        }
 
        public CommonGroupBuilder parentId(final Long parentId) {
            this.parentId = parentId;
            return this;
        }
 
        public CommonGroupBuilder extendId(final String extendId) {
            this.extendId = extendId;
            return this;
        }
 
        public CommonGroupBuilder fullName(final String fullName) {
            this.fullName = fullName;
            return this;
        }
 
        public CommonGroupBuilder code(final String code) {
            this.code = code;
            return this;
        }
 
        public CommonGroupBuilder name(final String name) {
            this.name = name;
            return this;
        }
 
        public CommonGroupBuilder groupType(final String groupType) {
            this.groupType = groupType;
            return this;
        }
 
        public CommonGroupBuilder groupCategory(final Integer groupCategory) {
            this.groupCategory = groupCategory;
            return this;
        }
 
        public CommonGroupBuilder groupTag(final String groupTag) {
            this.groupTag = groupTag;
            return this;
        }
 
        public CommonGroupBuilder sort(final Integer sort) {
            this.sort = sort;
            return this;
        }
 
        public CommonGroupBuilder remark(final String remark) {
            this.remark = remark;
            return this;
        }
 
        public CommonGroupBuilder isDeleted(final Integer isDeleted) {
            this.isDeleted = isDeleted;
            return this;
        }
 
        public CommonGroupBuilder status(final Integer status) {
            this.status = status;
            return this;
        }
 
        public CommonGroup build() {
            return new CommonGroup(this.id, this.tenantId, this.parentId, this.extendId, this.fullName, this.code, this.name, this.groupType, this.groupCategory, this.groupTag, this.sort, this.remark, this.isDeleted, this.status);
        }
 
        public String toString() {
            return "CommonGroup.CommonGroupBuilder(id=" + this.id + ", tenantId=" + this.tenantId + ", parentId=" + this.parentId + ", extendId=" + this.extendId + ", fullName=" + this.fullName + ", code=" + this.code + ", name=" + this.name + ", groupType=" + this.groupType + ", groupCategory=" + this.groupCategory + ", groupTag=" + this.groupTag + ", sort=" + this.sort + ", remark=" + this.remark + ", isDeleted=" + this.isDeleted + ", status=" + this.status + ")";
        }
    }
 
    public static CommonGroupBuilder builder() {
        return new CommonGroupBuilder();
    }
 
    public CommonGroup() {
    }
 
    public CommonGroup(final Long id, final String tenantId, final Long parentId, final String extendId, final String fullName, final String code, final String name, final String groupType, final Integer groupCategory, final String groupTag, final Integer sort, final String remark, final Integer isDeleted, final Integer status) {
        this.id = id;
        this.tenantId = tenantId;
        this.parentId = parentId;
        this.extendId = extendId;
        this.fullName = fullName;
        this.code = code;
        this.name = name;
        this.groupType = groupType;
        this.groupCategory = groupCategory;
        this.groupTag = groupTag;
        this.sort = sort;
        this.remark = remark;
        this.isDeleted = isDeleted;
        this.status = status;
    }
 
    public Long getId() {
        return this.id;
    }
 
    public String getTenantId() {
        return this.tenantId;
    }
 
    public Long getParentId() {
        return this.parentId;
    }
 
    public String getExtendId() {
        return this.extendId;
    }
 
    public String getFullName() {
        return this.fullName;
    }
 
    public String getCode() {
        return this.code;
    }
 
    public String getName() {
        return this.name;
    }
 
    public String getGroupType() {
        return this.groupType;
    }
 
    public Integer getGroupCategory() {
        return this.groupCategory;
    }
 
    public String getGroupTag() {
        return this.groupTag;
    }
 
    public Integer getSort() {
        return this.sort;
    }
 
    public String getRemark() {
        return this.remark;
    }
 
    public Integer getIsDeleted() {
        return this.isDeleted;
    }
 
    public Integer getStatus() {
        return this.status;
    }
 
    public static String createCode(Integer... numbers) {
        if (Func.isEmpty(numbers)) {
            return null;
        }
        return (String) Arrays.stream(numbers).map(number -> {
            return String.format(CommonConstant.PREFIX + CommonConstant.CODE_UNIT_LENGTH + CommonConstant.SUFFIX, number);
        }).collect(Collectors.joining(DncConstant.POINT));
    }
 
    public static String appendCode(String parentCode, String childCode) {
        if (Func.isEmpty(childCode)) {
            throw new IllegalArgumentException("inner-exception: childCode can not be null or empty.");
        }
        if (Func.isEmpty(parentCode)) {
            return childCode;
        }
        return parentCode + DncConstant.POINT + childCode;
    }
 
    public static String getRelativeCode(String code, String parentCode) {
        if (Func.isEmpty(code)) {
            throw new IllegalArgumentException("inner-exception: code can not be null or empty.");
        }
        if (Func.isEmpty(parentCode)) {
            return code;
        }
        if (code.length() == parentCode.length()) {
            return null;
        }
        return code.substring(parentCode.length() + 1);
    }
 
    public static String calculateNextCode(String code) {
        if (Func.isEmpty(code)) {
            throw new IllegalArgumentException("inner-exception: code can not be null or empty.");
        }
        String parentCode = getParentCode(code);
        String lastUnitCode = getLastUnitCode(code);
        return appendCode(parentCode, createCode(Integer.valueOf(Integer.parseInt(lastUnitCode) + 1)));
    }
 
    public static String getLastUnitCode(String code) {
        if (Func.isEmpty(code)) {
            throw new IllegalArgumentException("inner-exception: code can not be null or empty.");
        }
        String[] splittedCode = code.split("\\.");
        return splittedCode[splittedCode.length - 1];
    }
 
    public static String getParentCode(String code) {
        if (Func.isEmpty(code)) {
            throw new IllegalArgumentException("inner-exception: code can not be null or empty.");
        }
        String[] splittedCode = code.split("\\.");
        if (splittedCode.length == 1) {
            return null;
        }
        return (String) Arrays.stream(Arrays.copyOf(splittedCode, splittedCode.length - 1)).collect(Collectors.joining(DncConstant.POINT));
    }
 
    public static String appendName(String code, Map<String, String> map) {
        String name = "";
        if (Func.isBlank(code)) {
            return name;
        }
        Integer length = Integer.valueOf(code.length());
        for (int i = 5; i <= length.intValue(); i += 6) {
            if (Func.isBlank(name)) {
                if (map.containsKey(code.substring(0, i))) {
                    name = map.get(code.substring(0, i));
                }
            } else if (map.containsKey(code.substring(0, i))) {
                name = name + ">" + map.get(code.substring(0, i));
            } else {
                name = name + ">";
            }
        }
        return name;
    }
}