fix: 修复添加用户失败的BUG(因为telephone字段拼写错误)

This commit is contained in:
萌狼蓝天 2024-11-14 14:32:34 +08:00
parent 9774070d93
commit e292ddceab
2 changed files with 4 additions and 1 deletions

View File

@ -185,6 +185,8 @@ public class UserServiceImpl implements UserService {
userAddParam.setTelephone(userAddParam.getTelephone()==null?"":userAddParam.getTelephone());
userAddParam.setAvatar(userAddParam.getAvatar()==null?"":userAddParam.getAvatar());
userAddParam.setCode(userAddParam.getCode()==null?"":userAddParam.getCode());
log.info("开始创建新用户");
log.info(userAddParam.toString());
int result = userMapper.addUser(userAddParam);
if (result == 1) {
return ResponseResult.success(userAddParam);
@ -246,6 +248,7 @@ public class UserServiceImpl implements UserService {
// 设置不需要更新的字段为 null
userInfo.setPassword(null);
userInfo.setCreateTime(null);
userInfo.setStatus(String.valueOf(userAddParam.getStatus()));
// 使用 LambdaUpdateWrapper 构建更新条件
LambdaUpdateWrapper<UserInfo> updateWrapper = new LambdaUpdateWrapper<>();

View File

@ -75,7 +75,7 @@
INSERT INTO user_info (
id, name, username, password, avatar, status, telephone, email, create_time, merchant_code, deleted, role_id, creator_id
) VALUES (
#{id}, #{name}, #{username}, #{password}, #{avatar}, #{status}, #{telphone}, #{email}, #{createTime},
#{id}, #{name}, #{username}, #{password}, #{avatar}, #{status}, #{telephone}, #{email}, #{createTime},
#{merchantCode},
0, #{roleId}, #{creatorId}
)