修改用户信息bug修复
This commit is contained in:
@@ -480,8 +480,8 @@ public class CashController {
|
|||||||
@Login
|
@Login
|
||||||
@GetMapping(value = "/withdraw")
|
@GetMapping(value = "/withdraw")
|
||||||
@ApiOperation("发起提现 余额 金钱")
|
@ApiOperation("发起提现 余额 金钱")
|
||||||
public Result withdraw(Long userId, Double amount) {
|
public Result withdraw(Long userId, Double money) {
|
||||||
return cashOutService.withdraw(userId, amount, true);
|
return cashOutService.withdraw(userId, money, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.sqx.modules.sys.entity;
|
package com.sqx.modules.sys.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
@@ -22,7 +23,7 @@ import java.util.List;
|
|||||||
@TableName("sys_user")
|
@TableName("sys_user")
|
||||||
public class SysUserEntity implements Serializable {
|
public class SysUserEntity implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
*/
|
*/
|
||||||
@@ -39,6 +40,7 @@ public class SysUserEntity implements Serializable {
|
|||||||
* 密码
|
* 密码
|
||||||
*/
|
*/
|
||||||
@NotBlank(message="密码不能为空", groups = AddGroup.class)
|
@NotBlank(message="密码不能为空", groups = AddGroup.class)
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,40 +10,39 @@ import org.springframework.stereotype.Service;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户与角色对应关系
|
* 用户与角色对应关系
|
||||||
*
|
* @author GYJ
|
||||||
*/
|
*/
|
||||||
@Service("sysUserRoleService")
|
@Service("sysUserRoleService")
|
||||||
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleDao, SysUserRoleEntity> implements SysUserRoleService {
|
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleDao, SysUserRoleEntity> implements SysUserRoleService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveOrUpdate(Long userId, List<Long> roleIdList) {
|
public void saveOrUpdate(Long userId, List<Long> roleIdList) {
|
||||||
//先删除用户与角色关系
|
if (roleIdList == null || roleIdList.isEmpty()) {
|
||||||
this.removeByMap(new MapUtils().put("user_id", userId));
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(roleIdList == null || roleIdList.size() == 0){
|
//先删除用户与角色关系
|
||||||
return ;
|
this.removeByMap(new MapUtils().put("user_id", userId));
|
||||||
}
|
|
||||||
|
|
||||||
//保存用户与角色关系
|
//保存用户与角色关系
|
||||||
for(Long roleId : roleIdList){
|
for (Long roleId : roleIdList) {
|
||||||
SysUserRoleEntity sysUserRoleEntity = new SysUserRoleEntity();
|
SysUserRoleEntity sysUserRoleEntity = new SysUserRoleEntity();
|
||||||
sysUserRoleEntity.setUserId(userId);
|
sysUserRoleEntity.setUserId(userId);
|
||||||
sysUserRoleEntity.setRoleId(roleId);
|
sysUserRoleEntity.setRoleId(roleId);
|
||||||
|
|
||||||
this.save(sysUserRoleEntity);
|
this.save(sysUserRoleEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Long> queryRoleIdList(Long userId) {
|
public List<Long> queryRoleIdList(Long userId) {
|
||||||
return baseMapper.queryRoleIdList(userId);
|
return baseMapper.queryRoleIdList(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int deleteBatch(Long[] roleIds){
|
public int deleteBatch(Long[] roleIds) {
|
||||||
return baseMapper.deleteBatch(roleIds);
|
return baseMapper.deleteBatch(roleIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user