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;
|
}
|
}
|