WEB:客户管理

This commit is contained in:
2025-07-03 14:17:53 +08:00
parent b06e071196
commit 5bc56ca36d
5 changed files with 20 additions and 19 deletions

View File

@ -1,6 +1,7 @@
package com.fuyuanshen.customer.controller;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.crypto.digest.BCrypt;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuyuanshen.common.core.domain.ResponseVO;
import com.fuyuanshen.common.core.utils.StringUtils;
@ -63,6 +64,7 @@ public class CustomerController {
if (StringUtils.isBlank(customer.getPassword())) {
throw new BadRequestException("账号密码不能为空");
}
customer.setPassword(BCrypt.hashpw(customer.getPassword()));
customerService.addCustomer(customer);
return ResponseVO.success("新增客户成功!!!");
}

View File

@ -1,6 +1,7 @@
package com.fuyuanshen.customer.domain.vo;
import com.fuyuanshen.common.tenant.core.TenantEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
@ -16,11 +17,10 @@ import java.util.Objects;
*/
@Getter
@Setter
public class ConsumerVo implements Serializable {
public class ConsumerVo extends TenantEntity {
@Schema(name = "ID", hidden = true)
private Long id;
private Long customerId;
@Schema(hidden = true)
private Long deptId;
@ -31,9 +31,8 @@ public class ConsumerVo implements Serializable {
@Schema(hidden = true)
private Byte userLevel;
@Schema(name = "账号")
private String username;
private String userName;
@Schema(name = "用户昵称")
private String nickName;
@ -65,15 +64,9 @@ public class ConsumerVo implements Serializable {
@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) {
@ -83,13 +76,13 @@ public class ConsumerVo implements Serializable {
return false;
}
ConsumerVo consumer = (ConsumerVo) o;
return Objects.equals(id, consumer.id) && Objects.equals(username, consumer.username);
return Objects.equals(customerId, consumer.customerId) && Objects.equals(userName, consumer.userName);
}
@Override
public int hashCode() {
return Objects.hash(id, username);
return Objects.hash(customerId, userName);
}