0
0

WEB:客户管理

This commit is contained in:
2025-07-03 11:39:49 +08:00
parent abe9dc2fe8
commit b06e071196
11 changed files with 51 additions and 47 deletions

View File

@ -0,0 +1,131 @@
package com.fuyuanshen.customer.domain;
import com.baomidou.mybatisplus.annotation.*;
import com.fuyuanshen.common.core.constant.SystemConstants;
import com.fuyuanshen.common.tenant.core.TenantEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 用户对象 sys_user
*
* @author Lion Li
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("sys_user")
public class Customer extends TenantEntity {
/**
* 用户ID
*/
@TableId(value = "user_id")
private Long customerId;
/**
* 父id
*/
private Long pid;
/**
* 部门ID
*/
private Long deptId;
/**
* 用户账号
*/
@NotNull
private String userName;
/**
* 用户昵称
*/
@NotNull
private String nickName;
@TableField(value = "user_level")
private Byte userLevel;
/**
* 用户类型sys_user系统用户
*/
private String userType;
/**
* 用户邮箱
*/
private String email;
/**
* 手机号码
*/
private String phonenumber;
/**
* 用户性别
*/
private String sex;
/**
* 用户头像
*/
private Long avatar;
/**
* 密码
*/
@TableField(
insertStrategy = FieldStrategy.NOT_EMPTY,
updateStrategy = FieldStrategy.NOT_EMPTY,
whereStrategy = FieldStrategy.NOT_EMPTY
)
private String password;
/**
* 帐号状态0正常 1停用
*/
private String status;
/**
* 删除标志0代表存在 1代表删除
*/
@TableLogic
private String delFlag;
@NotNull
@Schema(name = "是否启用")
private Boolean enabled;
/**
* 最后登录IP
*/
private String loginIp;
/**
* 最后登录时间
*/
private Date loginDate;
/**
* 备注
*/
private String remark;
public Customer(Long userId) {
this.customerId = userId;
}
public boolean isSuperAdmin() {
return SystemConstants.SUPER_ADMIN_ID.equals(this.customerId);
}
}

View File

@ -0,0 +1,87 @@
/*
* Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.fuyuanshen.customer.domain.query;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* @author Zheng Jie
* @date 2018-11-23
*/
@Data
public class UserQueryCriteria implements Serializable {
@Schema(name = "ID")
private Long id;
@Schema(name = "ids")
private Set<Long> ids;
@Schema(name = "pid")
private Long pid;
@Schema(name = "多个ID")
private Set<Long> deptIds = new HashSet<>();
@Schema(name = "模糊查询")
private String blurry;
@Schema(name = "是否启用")
private Boolean enabled;
@Schema(name = "部门ID")
private Long deptId;
@Schema(name = "创建时间")
private List<Timestamp> createTime;
@Schema(name = "页码", example = "1")
private Integer pageNum = 1;
@Schema(name = "每页数据量", example = "10")
private Integer pageSize = 10;
@Schema(name = "偏移量", hidden = true)
private long offset;
/**
* 用户类型
* 0 app
* 1 小程序
*/
@Schema(name = "用户类型 0 app 1 小程序")
private Integer userType;
/**
* 账号
*/
@Schema(name = "APP/小程序账号")
private String username;
/**
* 客户名称
*/
@Schema(name = "客户名称")
private String customerName;
}

View File

@ -0,0 +1,96 @@
package com.fuyuanshen.customer.domain.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* @author: 默苍璃
* @date: 2025-06-1211:34
*/
@Getter
@Setter
public class ConsumerVo implements Serializable {
@Schema(name = "ID", hidden = true)
private Long id;
@Schema(hidden = true)
private Long deptId;
@Schema(hidden = true)
private Long pid;
@Schema(hidden = true)
private Byte userLevel;
@Schema(name = "账号")
private String username;
@Schema(name = "用户昵称")
private String nickName;
@Schema(name = "邮箱")
private String email;
@Schema(name = "电话号码")
private String phone;
@Schema(name = "用户性别")
private String gender;
@Schema(name = "头像真实名称", hidden = true)
private String avatarName;
@Schema(name = "头像存储的路径", hidden = true)
private String avatarPath;
@Schema(name = "密码")
private String password;
@Schema(name = "是否启用")
private Boolean enabled;
@Schema(name = "是否为admin账号", hidden = true)
private Boolean isAdmin = false;
@Schema(name = "最后修改密码的时间", hidden = true)
private Date pwdResetTime;
/**
* 租户ID
*/
@Schema(hidden = true)
private Long tenantId;
private List<ConsumerVo> children;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConsumerVo consumer = (ConsumerVo) o;
return Objects.equals(id, consumer.id) && Objects.equals(username, consumer.username);
}
@Override
public int hashCode() {
return Objects.hash(id, username);
}
}