Merge branch 'master' of http://121.40.234.130:8899/root/nl-sso-server
This commit is contained in:
@@ -17,6 +17,7 @@ package org.nl.modules.system.rest;
|
|||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.dev33.satoken.secure.SaSecureUtil;
|
import cn.dev33.satoken.secure.SaSecureUtil;
|
||||||
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -74,26 +75,26 @@ public class UserController {
|
|||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* @Log("修改用户")
|
@Log("修改用户")
|
||||||
@ApiOperation("修改用户")
|
@ApiOperation("修改用户")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@SaCheckPermission("user:edit")
|
@SaCheckPermission("user:edit")
|
||||||
public ResponseEntity<Object> update(@Validated(User.Update.class) @RequestBody User resources) throws Exception {
|
public ResponseEntity<Object> update( @RequestBody User resources) throws Exception {
|
||||||
checkLevel(resources);
|
checkLevel(resources);
|
||||||
userService.update(resources);
|
userService.update(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
/* @Log("修改用户:个人中心")
|
@Log("修改用户:个人中心")
|
||||||
@ApiOperation("修改用户:个人中心")
|
@ApiOperation("修改用户:个人中心")
|
||||||
@PutMapping(value = "center")
|
@PutMapping(value = "center")
|
||||||
public ResponseEntity<Object> center(@Validated(User.Update.class) @RequestBody User resources){
|
public ResponseEntity<Object> center(@RequestBody User resources){
|
||||||
if(!resources.getUser_id().equals(StpUtil.getLoginIdAsLong())){
|
if(!resources.getUser_id().equals(StpUtil.getLoginIdAsLong())){
|
||||||
throw new BadRequestException("不能修改他人资料");
|
throw new BadRequestException("不能修改他人资料");
|
||||||
}
|
}
|
||||||
userService.updateCenter(resources);
|
userService.updateCenter(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
@Log("删除用户")
|
@Log("删除用户")
|
||||||
@ApiOperation("删除用户")
|
@ApiOperation("删除用户")
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import java.util.Objects;
|
|||||||
public class DeptTree implements Serializable {
|
public class DeptTree implements Serializable {
|
||||||
|
|
||||||
private Long Dept_id;
|
private Long Dept_id;
|
||||||
|
|
||||||
private Long pid;
|
private Long pid;
|
||||||
private String name;
|
private String name;
|
||||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||||
|
|||||||
@@ -41,8 +41,7 @@ public class UserQueryCriteria implements Serializable {
|
|||||||
|
|
||||||
private Boolean needAll;
|
private Boolean needAll;
|
||||||
|
|
||||||
@Query
|
private String is_used;
|
||||||
private Boolean is_used;
|
|
||||||
|
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
|
|||||||
@@ -297,7 +297,6 @@ public class DeptServiceImpl implements DeptService {
|
|||||||
Set<Long> set = new HashSet<>();
|
Set<Long> set = new HashSet<>();
|
||||||
//添加本级
|
//添加本级
|
||||||
set.add(pid);
|
set.add(pid);
|
||||||
|
|
||||||
//添加子节点
|
//添加子节点
|
||||||
try {
|
try {
|
||||||
List<Entity> list = Db.use((DataSource) SpringContextHolder.getBean("dataSource")).query(sql);
|
List<Entity> list = Db.use((DataSource) SpringContextHolder.getBean("dataSource")).query(sql);
|
||||||
|
|||||||
@@ -81,12 +81,14 @@ public class UserServiceImpl implements UserService {
|
|||||||
}
|
}
|
||||||
JSONObject o = (JSONObject)JSON.toJSON(criteria);
|
JSONObject o = (JSONObject)JSON.toJSON(criteria);
|
||||||
HashMap map = MapOf.of("user_id", MapUtil.getStr(o, "user_id")
|
HashMap map = MapOf.of("user_id", MapUtil.getStr(o, "user_id")
|
||||||
, "blurry", MapUtil.getStr(o, "blurry")
|
|
||||||
, "is_used", MapUtil.getStr(o, "is_used")
|
, "is_used", MapUtil.getStr(o, "is_used")
|
||||||
, "startTime", MapUtil.getStr(o, "startTime")
|
, "startTime", MapUtil.getStr(o, "startTime")
|
||||||
, "endTime", MapUtil.getStr(o, "endTime")
|
, "endTime", MapUtil.getStr(o, "endTime")
|
||||||
, "deptId", MapUtil.getStr(o, "deptId")
|
, "deptId", MapUtil.getStr(o, "deptId")
|
||||||
);
|
);
|
||||||
|
if (ObjectUtil.isNotEmpty(MapUtil.getStr(o, "blurry"))){
|
||||||
|
map.put("blurry","'%"+MapUtil.getStr(o, "blurry")+"%'");
|
||||||
|
}
|
||||||
if (!CollectionUtils.isEmpty(criteria.getDeptIds())){
|
if (!CollectionUtils.isEmpty(criteria.getDeptIds())){
|
||||||
String collectSql = criteria.getDeptIds().stream().map(a -> String.valueOf(a)).collect(Collectors.joining("','"));
|
String collectSql = criteria.getDeptIds().stream().map(a -> String.valueOf(a)).collect(Collectors.joining("','"));
|
||||||
map.put("deptIds","('"+collectSql+"')");
|
map.put("deptIds","('"+collectSql+"')");
|
||||||
|
|||||||
@@ -92,3 +92,20 @@
|
|||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDPAGEQUERY
|
ENDPAGEQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "2"
|
||||||
|
PAGEQUERY
|
||||||
|
SELECT
|
||||||
|
max(t3.childId)
|
||||||
|
from
|
||||||
|
(
|
||||||
|
select *,
|
||||||
|
if( find_in_set(t1.pid, @p) > 0,@p := concat(@p,',',id),0 ) as childId
|
||||||
|
from
|
||||||
|
(select dept_id as id, pid from sys_dept t order by id) t1,
|
||||||
|
(select @p := '输入.pid') t2
|
||||||
|
) t3
|
||||||
|
where childId != '0'
|
||||||
|
ENDSELECT
|
||||||
|
ENDPAGEQUERY
|
||||||
|
ENDIF
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
输入.deptIds TYPEAS f_string
|
输入.deptIds TYPEAS f_string
|
||||||
输入.deptId TYPEAS f_string
|
输入.deptId TYPEAS f_string
|
||||||
输入.id TYPEAS s_string
|
输入.id TYPEAS s_string
|
||||||
输入.blurry TYPEAS s_string
|
输入.blurry TYPEAS f_string
|
||||||
输入.is_used TYPEAS s_string
|
输入.is_used TYPEAS s_string
|
||||||
输入.startTime TYPEAS s_string
|
输入.startTime TYPEAS s_string
|
||||||
输入.endTime TYPEAS s_string
|
输入.endTime TYPEAS s_string
|
||||||
@@ -63,10 +63,10 @@
|
|||||||
sys_user_dept.dept_id in 输入.deptIds
|
sys_user_dept.dept_id in 输入.deptIds
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
OPTION 输入.blurry <> ""
|
OPTION 输入.blurry <> ""
|
||||||
(email like 输入.blurry or username like 输入.blurry or nickName like 输入.blurry)
|
(email like 输入.blurry or username like 输入.blurry or person_name like 输入.blurry)
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
OPTION 输入.is_used <> ""
|
OPTION 输入.is_used <> ""
|
||||||
sys_user.is_used = 输入.enabled
|
sys_user.is_used = 输入.is_used
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
OPTION 输入.deptId <> ""
|
OPTION 输入.deptId <> ""
|
||||||
sys_user_dept.dept_id = 输入.deptId
|
sys_user_dept.dept_id = 输入.deptId
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ export function getDepts(params) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getDeptTreee() {
|
export function getDeptTreee(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/dept/allTree',
|
url: '/api/dept/allTree',
|
||||||
method: 'get'
|
method: 'get',
|
||||||
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
@keyup.enter.native="crud.toQuery"
|
@keyup.enter.native="crud.toQuery"
|
||||||
/>
|
/>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="query.enabled"
|
v-model="query.is_used"
|
||||||
clearable
|
clearable
|
||||||
size="mini"
|
size="mini"
|
||||||
placeholder="状态"
|
placeholder="状态"
|
||||||
@@ -78,10 +78,9 @@
|
|||||||
<el-input v-model="form.email" style="width: 200px;" />
|
<el-input v-model="form.email" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="部门" prop="dept.id" :rules="[{ required: true, message: '请选择部门', trigger: 'change' }]">
|
<el-form-item label="部门" prop="dept.id" :rules="[{ required: true, message: '请选择部门', trigger: 'change' }]">
|
||||||
<treeselect
|
<el-tree-select
|
||||||
v-model="form.dept.id"
|
v-model="form.dept.id"
|
||||||
:options="depts"
|
:data="deptDatas"
|
||||||
:load-options="loadDepts"
|
|
||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
placeholder="选择部门"
|
placeholder="选择部门"
|
||||||
/>
|
/>
|
||||||
@@ -111,6 +110,8 @@
|
|||||||
v-model="roleDatas"
|
v-model="roleDatas"
|
||||||
style="width: 512px"
|
style="width: 512px"
|
||||||
multiple
|
multiple
|
||||||
|
active-value="1"
|
||||||
|
inactive-value="0"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
@remove-tag="deleteTag"
|
@remove-tag="deleteTag"
|
||||||
@change="changeRole"
|
@change="changeRole"
|
||||||
@@ -243,8 +244,8 @@ export default {
|
|||||||
del: ['admin', 'user:del']
|
del: ['admin', 'user:del']
|
||||||
},
|
},
|
||||||
enabledTypeOptions: [
|
enabledTypeOptions: [
|
||||||
{ key: 'true', display_name: '激活' },
|
{ key: '1', display_name: '激活' },
|
||||||
{ key: 'false', display_name: '锁定' }
|
{ key: '0', display_name: '锁定' }
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
username: [
|
username: [
|
||||||
@@ -338,20 +339,9 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取左侧部门数据
|
// 获取左侧部门数据
|
||||||
getDeptDatas(node, resolve) {
|
getDeptDatas(node, resolve) {
|
||||||
console.log('node', node)
|
debugger
|
||||||
console.log('resolve', resolve)
|
|
||||||
const sort = 'id,desc'
|
|
||||||
const params = { sort: sort }
|
|
||||||
if (typeof node !== 'object') {
|
|
||||||
if (node) {
|
|
||||||
params['name'] = node
|
|
||||||
}
|
|
||||||
} else if (node.level !== 0) {
|
|
||||||
params['pid'] = node.data.id
|
|
||||||
}
|
|
||||||
console.log('params', params)
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getDeptTreee().then(res => {
|
getDeptTreee({ name: node }).then(res => {
|
||||||
console.log('res', res)
|
console.log('res', res)
|
||||||
if (resolve) {
|
if (resolve) {
|
||||||
resolve(res.content)
|
resolve(res.content)
|
||||||
@@ -365,7 +355,6 @@ export default {
|
|||||||
getDeptTree() {
|
getDeptTree() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getDeptTreee().then(res => {
|
getDeptTreee().then(res => {
|
||||||
debugger
|
|
||||||
this.deptDatas = res.content
|
this.deptDatas = res.content
|
||||||
})
|
})
|
||||||
}, 100)
|
}, 100)
|
||||||
@@ -374,6 +363,7 @@ export default {
|
|||||||
console.log('获取部门')
|
console.log('获取部门')
|
||||||
getDepts({ is_used: 1 }).then(res => {
|
getDepts({ is_used: 1 }).then(res => {
|
||||||
console.log('获取的部门信息', res)
|
console.log('获取的部门信息', res)
|
||||||
|
|
||||||
this.depts = res.content.map(function(obj) {
|
this.depts = res.content.map(function(obj) {
|
||||||
if (obj.hasChildren) {
|
if (obj.hasChildren) {
|
||||||
obj.children = null
|
obj.children = null
|
||||||
@@ -402,6 +392,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取弹窗内部门数据
|
// 获取弹窗内部门数据
|
||||||
loadDepts({ action, parentNode, callback }) {
|
loadDepts({ action, parentNode, callback }) {
|
||||||
|
debugger
|
||||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
getDepts({ is_used: 1, pid: parentNode.id }).then(res => {
|
getDepts({ is_used: 1, pid: parentNode.id }).then(res => {
|
||||||
parentNode.children = res.content.map(function(obj) {
|
parentNode.children = res.content.map(function(obj) {
|
||||||
|
|||||||
Reference in New Issue
Block a user