use of com.ruoyi.common.core.domain.entity.SysUser in project RuoYi-Flowable-Plus by KonBAI-Q.
the class SysProfileController method profile.
/**
* 个人信息
*/
@ApiOperation("个人信息")
@GetMapping
public R<Map<String, Object>> profile() {
SysUser user = userService.selectUserById(getUserId());
Map<String, Object> ajax = new HashMap<>();
ajax.put("user", user);
ajax.put("roleGroup", userService.selectUserRoleGroup(user.getUserName()));
ajax.put("postGroup", userService.selectUserPostGroup(user.getUserName()));
return R.ok(ajax);
}
use of com.ruoyi.common.core.domain.entity.SysUser in project RuoYi-Flowable-Plus by KonBAI-Q.
the class SysUserController method export.
@ApiOperation("导出用户列表")
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
@SaCheckPermission("system:user:export")
@PostMapping("/export")
public void export(SysUser user, HttpServletResponse response) {
List<SysUser> list = userService.selectUserList(user);
List<SysUserExportVo> listVo = BeanUtil.copyToList(list, SysUserExportVo.class);
for (int i = 0; i < list.size(); i++) {
SysDept dept = list.get(i).getDept();
SysUserExportVo vo = listVo.get(i);
if (ObjectUtil.isNotEmpty(dept)) {
vo.setDeptName(dept.getDeptName());
vo.setLeader(dept.getLeader());
}
}
ExcelUtil.exportExcel(listVo, "用户数据", SysUserExportVo.class, response);
}
use of com.ruoyi.common.core.domain.entity.SysUser in project RuoYi-Flowable-Plus by KonBAI-Q.
the class SysLoginController method getInfo.
/**
* 获取用户信息
*
* @return 用户信息
*/
@ApiOperation("获取用户信息")
@GetMapping("getInfo")
public R<Map<String, Object>> getInfo() {
SysUser user = userService.selectUserById(LoginHelper.getUserId());
// 角色集合
Set<String> roles = permissionService.getRolePermission(user);
// 权限集合
Set<String> permissions = permissionService.getMenuPermission(user);
Map<String, Object> ajax = new HashMap<>();
ajax.put("user", user);
ajax.put("roles", roles);
ajax.put("permissions", permissions);
return R.ok(ajax);
}
use of com.ruoyi.common.core.domain.entity.SysUser in project RuoYi-Flowable-Plus by KonBAI-Q.
the class WfTaskServiceImpl method finishedList.
/**
* 已办任务列表
*
* @return
*/
@Override
public TableDataInfo<WfTaskVo> finishedList(PageQuery pageQuery) {
Page<WfTaskVo> page = new Page<>();
Long userId = LoginHelper.getUserId();
HistoricTaskInstanceQuery taskInstanceQuery = historyService.createHistoricTaskInstanceQuery().includeProcessVariables().finished().taskAssignee(userId.toString()).orderByHistoricTaskInstanceEndTime().desc();
int offset = pageQuery.getPageSize() * (pageQuery.getPageNum() - 1);
List<HistoricTaskInstance> historicTaskInstanceList = taskInstanceQuery.listPage(offset, pageQuery.getPageSize());
List<WfTaskVo> hisTaskList = Lists.newArrayList();
for (HistoricTaskInstance histTask : historicTaskInstanceList) {
WfTaskVo flowTask = new WfTaskVo();
// 当前流程信息
flowTask.setTaskId(histTask.getId());
// 审批人员信息
flowTask.setCreateTime(histTask.getCreateTime());
flowTask.setFinishTime(histTask.getEndTime());
flowTask.setDuration(getDate(histTask.getDurationInMillis()));
flowTask.setProcDefId(histTask.getProcessDefinitionId());
flowTask.setTaskDefKey(histTask.getTaskDefinitionKey());
flowTask.setTaskName(histTask.getName());
// 流程定义信息
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionId(histTask.getProcessDefinitionId()).singleResult();
flowTask.setDeployId(pd.getDeploymentId());
flowTask.setProcDefName(pd.getName());
flowTask.setProcDefVersion(pd.getVersion());
flowTask.setProcInsId(histTask.getProcessInstanceId());
flowTask.setHisProcInsId(histTask.getProcessInstanceId());
// 流程发起人信息
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(histTask.getProcessInstanceId()).singleResult();
SysUser startUser = sysUserService.selectUserById(Long.parseLong(historicProcessInstance.getStartUserId()));
flowTask.setStartUserId(startUser.getNickName());
flowTask.setStartUserName(startUser.getNickName());
flowTask.setStartDeptName(startUser.getDept().getDeptName());
hisTaskList.add(flowTask);
}
page.setTotal(taskInstanceQuery.count());
page.setRecords(hisTaskList);
// result.put("finished",true);
return TableDataInfo.build(page);
}
use of com.ruoyi.common.core.domain.entity.SysUser in project RuoYi-Flowable-Plus by KonBAI-Q.
the class SysLoginService method recordLoginInfo.
/**
* 记录登录信息
*
* @param userId 用户ID
*/
public void recordLoginInfo(Long userId, String username) {
SysUser sysUser = new SysUser();
sysUser.setUserId(userId);
sysUser.setLoginIp(ServletUtils.getClientIP());
sysUser.setLoginDate(DateUtils.getNowDate());
sysUser.setUpdateBy(username);
userService.updateUserProfile(sysUser);
}
Aggregations