|
|
@ -39,6 +39,7 @@ import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
@ -59,6 +60,7 @@ import java.sql.ResultSet;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.function.Function;
|
|
|
|
import java.util.function.Function;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
|
|
|
|
|
|
import static java.util.stream.Collectors.toCollection;
|
|
|
|
import static java.util.stream.Collectors.toCollection;
|
|
|
|
|
|
|
|
|
|
|
@ -290,6 +292,31 @@ public class SysUserController extends CoreBaseController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 根据登录的用户名批量修改账号状态
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param userLoginNames 用户名数组
|
|
|
|
|
|
|
|
* @param status 状态
|
|
|
|
|
|
|
|
* @return 处理结果
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@PutMapping(value = "/batch-status/userLoginNames")
|
|
|
|
|
|
|
|
@ApiOperation(value = "根据用户名批量修改账号状态", notes = "根据用户名批量修改账号状态")
|
|
|
|
|
|
|
|
public ResultBean updateBatchStatusByUserLoginNames(String[] userLoginNames, int status) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
if(ObjectUtils.isEmpty(userLoginNames)){
|
|
|
|
|
|
|
|
return ResultBean.success("操作失败").setCode(ResourceEnumUtil.MESSAGE.FAIL.getCode()).setErrorMsg("用户名不能为空");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ValidatorBean.checkNotZero(status, "账号状态不能为空");
|
|
|
|
|
|
|
|
List<String> userLoginNameList = Stream.of(userLoginNames).collect(Collectors.toList());
|
|
|
|
|
|
|
|
sysUserService.updateBatchSysUserStatusByUserLoginNames(userLoginNameList,status,AuthUtil.getSessionUser());
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 修改当前登录用户密码
|
|
|
|
* 修改当前登录用户密码
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param password 原密码
|
|
|
|
* @param password 原密码
|
|
|
|