Commit 71914486 by yuwei

项目初始化

parent 40114f1a
......@@ -134,5 +134,13 @@ public class UserController extends BaseController {
Map<String, Object> result = userService.getRouteById(id);
return R.ok().setData(result);
}
@ApiOperation(value = "获取审核用户", notes = "获取审核用户")
@GetMapping("/audit")
public R getAuditUsers() {
List<UserEntity> list = userService.getAuditUsers();
List<UserVo> collect = list.stream().map(userMapper::toVO).collect(Collectors.toList());
return R.ok().setData(collect);
}
}
......@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.io.Serializable;
import java.util.List;
/**
* <p>
......@@ -31,4 +32,6 @@ public interface UserDao extends BaseDao<UserEntity> {
@Override
<E extends IPage<UserEntity>> E selectPage(E page, @Param(Constants.WRAPPER) Wrapper<UserEntity> queryWrapper);
List<UserEntity> getAuditUsers(@Param("roleCode") String roleCode, @Param("userId") String userId);
}
......@@ -37,4 +37,6 @@ public interface UserService extends BaseService<UserEntity> {
IPage<UserEntity> pageDataScope(IPage<UserEntity> page, Wrapper<UserEntity> queryWrapper, DataScope dataScope);
Map<String, Object> getRouteById(String id);
List<UserEntity> getAuditUsers();
}
......@@ -3,6 +3,7 @@ package cn.datax.service.system.service.impl;
import cn.datax.common.base.DataScope;
import cn.datax.common.core.DataConstant;
import cn.datax.common.exception.DataException;
import cn.datax.common.utils.SecurityUtil;
import cn.datax.service.system.api.dto.UserDto;
import cn.datax.service.system.api.dto.UserPasswordDto;
import cn.datax.service.system.api.entity.*;
......@@ -217,4 +218,12 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
}
return result;
}
@Override
public List<UserEntity> getAuditUsers() {
String roleCode = "audit";
String userId = SecurityUtil.getUserId();
List<UserEntity> list = userDao.getAuditUsers(roleCode, userId);
return list;
}
}
......@@ -99,4 +99,11 @@
FROM sys_user
${ew.customSqlSegment}
</select>
<select id="getAuditUsers" resultMap="BaseResultMap">
SELECT u.id, u.username, u.nickname FROM sys_user u
LEFT JOIN sys_user_role ur ON ur.user_id = u.id
LEFT JOIN sys_role r ON r.id = ur.role_id
WHERE r.role_code = #{roleCode} and u.id != #{userId}
</select>
</mapper>
......@@ -91,3 +91,10 @@ export function updatePassword(data) {
data: data
})
}
export function getAuditUsers() {
return request({
url: '/system/users/audit',
method: 'get'
})
}
<template>
<el-dialog title="审核人选择" width="50%" :visible.sync="dialogVisible">
<el-transfer
v-model="value"
:data="data"
:props="{
key: 'id',
label: 'username'
}"
@left-check-change="leftCheckChange($event)"
@change="change($event)"
>
<span slot-scope="{ option }">{{ option.username }}({{ option.nickname }})</span>
</el-transfer>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit">确认</el-button>
<el-button @click="dialogVisible = false">取消</el-button>
</span>
</el-dialog>
</template>
<script>
import { getAuditUsers } from '@/api/system/user'
import { executeTask } from '@/api/workflow/task'
export default {
name: 'HandleUser',
props: {
visible: {
type: Boolean,
default: function() {
return false
}
},
task: {
type: Object,
default: function() {
return {}
}
},
action: {
type: String,
default: function() {
return ''
}
}
},
data() {
return {
data: [],
value: []
}
},
computed: {
dialogVisible: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
created() {
this.getList()
},
methods: {
getList() {
getAuditUsers().then(response => {
if (response.success) {
this.data = response.data
console.log(this.data)
}
})
},
leftCheckChange(e) {
if (e.length === 0) {
this.data.forEach((item, index) => {
delete item['disabled']
})
}
if (e.length === 1) {
this.data.forEach((item, index) => {
if (e[0] !== item.id) {
item['disabled'] = true
}
})
}
},
change(e) {
if (this.value.length === 0) {
this.data.forEach((item, index) => {
delete item['disabled']
})
}
},
submit() {
if (this.value.length === 0) {
this.$message.warning('请先选择审核人员')
return false
}
this.$confirm('确认选择该审核人员, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const data = {
action: this.action,
processInstanceId: this.task.processInstanceId,
taskId: this.task.id,
userId: this.value[0],
message: ''
}
executeTask(data).then(response => {
if (response.success) {
this.$message.success('审核人员设置成功')
this.dialogVisible = false
this.$emit('handleTaskUserFinished')
}
})
}).catch(() => {
})
}
}
}
</script>
<style lang="scss" scoped>
.el-transfer ::v-deep .el-transfer-panel__header {
display: none;
}
</style>
......@@ -109,6 +109,7 @@
<!-- 任务审核对话框 -->
<handle-task v-if="dialogHandleTaskVisible" :visible.sync="dialogHandleTaskVisible" :task="currentTask" @handleTaskFinished="getList"></handle-task>
<handle-user v-if="dialogHandleUserVisible" :visible.sync="dialogHandleUserVisible" :task="currentTask" :action="taskAction" @handleTaskUserFinished="getList"></handle-user>
</el-card>
</template>
......@@ -116,10 +117,11 @@
import { pageTodoTask, executeTask } from '@/api/workflow/task'
import { mapGetters } from 'vuex'
import HandleTask from '../components/HandleTask'
import HandleUser from '../components/HandleUser'
export default {
name: 'TaskTodoList',
components: { HandleTask },
components: { HandleTask, HandleUser },
data() {
return {
tableHeight: document.body.offsetHeight - 310 + 'px',
......@@ -148,7 +150,9 @@ export default {
businessName: ''
},
dialogHandleTaskVisible: false,
currentTask: {}
currentTask: {},
dialogHandleUserVisible: false,
taskAction: ''
}
},
created() {
......@@ -233,8 +237,16 @@ export default {
}).catch(() => {
})
},
handleDelegate(row) {},
handleAssignee(row) {},
handleDelegate(row) {
this.taskAction = 'delegate'
this.currentTask = Object.assign({}, row)
this.dialogHandleUserVisible = true
},
handleAssignee(row) {
this.taskAction = 'assignee'
this.currentTask = Object.assign({}, row)
this.dialogHandleUserVisible = true
},
handleTask(row) {
this.currentTask = Object.assign({}, row)
this.dialogHandleTaskVisible = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment