diff --git a/src/main/java/com/guaiguailang/harmony/service/impl/UserServiceImpl.java b/src/main/java/com/guaiguailang/harmony/service/impl/UserServiceImpl.java index b8e12d6..82e74a7 100644 --- a/src/main/java/com/guaiguailang/harmony/service/impl/UserServiceImpl.java +++ b/src/main/java/com/guaiguailang/harmony/service/impl/UserServiceImpl.java @@ -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 updateWrapper = new LambdaUpdateWrapper<>(); diff --git a/src/main/resources/mapper/UserMapper.xml b/src/main/resources/mapper/UserMapper.xml index 837c548..3b47e49 100644 --- a/src/main/resources/mapper/UserMapper.xml +++ b/src/main/resources/mapper/UserMapper.xml @@ -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} )