2
0

fix: 添加出生日期字段

This commit is contained in:
caiyuchao
2025-02-19 16:31:58 +08:00
parent 1749442161
commit 7c048fe254
8 changed files with 37 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
ALTER TABLE `wfc_user_db`.`u_user`
ADD COLUMN `birth_date` date NULL COMMENT '出生日期' AFTER `age`
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -765,6 +765,7 @@ CREATE TABLE `u_user` (
`avatar` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '头像地址',
`password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '密码',
`age` int(11) NULL DEFAULT NULL COMMENT '年龄',
`birth_date` date DEFAULT NULL COMMENT '出生日期',
`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '帐号状态0正常 1停用',
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志0代表存在 2代表删除',

View File

@@ -36,6 +36,10 @@ public class UUser extends BaseEntity
@Excel(name = "登录名称")
private String userName;
/** 出生日期 */
@Excel(name = "出生日期")
private Date birthDate;
/** 用户昵称 */
@Excel(name = "用户名称")
private String nickName;
@@ -332,6 +336,14 @@ public class UUser extends BaseEntity
return roleId;
}
public Date getBirthDate() {
return birthDate;
}
public void setBirthDate(Date birthDate) {
this.birthDate = birthDate;
}
public void setRoleId(Long roleId)
{
this.roleId = roleId;
@@ -368,6 +380,7 @@ public class UUser extends BaseEntity
.append("remark", getRemark())
.append("dept", getDept())
.append("kycStatus", getKycStatus())
.append("birthDate", getBirthDate())
.toString();
}
}

View File

@@ -148,6 +148,7 @@ public class ULoginService {
user.setAddress(registerBody.getAddress());
user.setEmail(registerBody.getEmail());
user.setPhonenumber(registerBody.getPhonenumber());
user.setBirthDate(registerBody.getBirthDate());
R<?> registerResult = remoteUserService.registerUserInfo(user, SecurityConstants.INNER);
if (R.FAIL == registerResult.getCode()) {

View File

@@ -2,6 +2,8 @@ package org.wfc.common.core.web.form;
import lombok.Data;
import java.util.Date;
/**
* 用户注册对象
*
@@ -30,6 +32,11 @@ public class RegisterBody extends LoginBody {
*/
private String address;
/**
* 出生日期
*/
private Date birthDate;
/**
* 性别
*/

View File

@@ -62,6 +62,9 @@ public class UUser {
@Schema(description = "年龄")
private Integer age;
@Schema(description = "出生日期")
private Date birthDate;
@Schema(description = "地址")
private String address;

View File

@@ -88,6 +88,9 @@ public class UProfileController extends BaseController
if (user.getSex() != null) {
currentUser.setSex(user.getSex());
}
if (user.getBirthDate() != null) {
currentUser.setBirthDate(user.getBirthDate());
}
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
{
return error(MessageUtils.message("user.modify.user.phone.exist", loginUser.getUsername()));

View File

@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="fullName" column="full_name" />
<result property="age" column="age" />
<result property="address" column="address" />
<result property="birthDate" column="birth_date" />
<result property="kycStatus" column="kyc_status" />
<association property="dept" javaType="UDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
@@ -63,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.full_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.age, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.full_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.age, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.birth_date,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,
k.status as kyc_status
@@ -75,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectUserList" parameterType="UUser" resultMap="UUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.full_name, u.email, u.avatar, u.phonenumber, u.sex, u.age, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.full_name, u.email, u.avatar, u.phonenumber, u.sex, u.age, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.birth_date,
d.dept_name, d.leader,
k.status as kyc_status
from u_user u
@@ -189,6 +190,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fullName != null and fullName != ''">full_name,</if>
<if test="age != null and age != ''">age,</if>
<if test="address != null and address != ''">address,</if>
<if test="birthDate != null">birth_date,</if>
create_time
)values(
<if test="userId != null and userId != ''">#{userId},</if>
@@ -206,6 +208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fullName != null and fullName != ''">#{fullName},</if>
<if test="age != null and age != ''">#{age},</if>
<if test="address != null and address != ''">#{address},</if>
<if test="birthDate != null">#{birthDate},</if>
sysdate()
)
</insert>
@@ -227,6 +230,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
<if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="birthDate != null">birth_date = #{birthDate},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = sysdate()
</set>