当前角色问题解决
This commit is contained in:
@@ -64,7 +64,7 @@ public interface SysRoleMapper extends BaseMapperPlus<SysRoleMapper, SysRole, Sy
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
SysRole getCurrentRole(Long userId);
|
||||
List<SysRole> getCurrentRole(Long userId);
|
||||
|
||||
Long[] selectTempRoleByName();
|
||||
|
||||
|
||||
@@ -186,6 +186,6 @@ public interface ISysRoleService {
|
||||
Long[] selectTempRoleByName();
|
||||
|
||||
|
||||
SysRole getCurrentRole();
|
||||
List<SysRole> getCurrentRole();
|
||||
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysRole getCurrentRole() {
|
||||
public List<SysRole> getCurrentRole() {
|
||||
|
||||
return baseMapper.getCurrentRole(LoginHelper.getUserId());
|
||||
}
|
||||
|
||||
@@ -590,12 +590,10 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
||||
.processInstanceId(histTask.getProcessInstanceId())
|
||||
.singleResult();
|
||||
Long userId = Long.parseLong(historicProcessInstance.getStartUserId());
|
||||
String nickName = userService.selectNickNameById(userId);
|
||||
flowTask.setStartUserId(userId);
|
||||
flowTask.setStartUserName(nickName);
|
||||
|
||||
SysUser sysUser = sysUserService.selectUserByIdAndNotDelFlag(userId);
|
||||
flowTask.setStartUserId(sysUser.getUserId());
|
||||
flowTask.setStartUserName(sysUser.getNickName());
|
||||
//获取部门信息(新增于2024年2月29日)
|
||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||
if (sysUser.getDeptId()!=null){
|
||||
SysDept sysDept = sysDeptService.selectDeptById(sysUser.getDeptId());
|
||||
flowTask.setDeptName(sysDept.getDeptName());
|
||||
|
||||
@@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.common.core.service.UserService;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.helper.LoginHelper;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.flowable.common.constant.ProcessConstants;
|
||||
import com.ruoyi.flowable.common.constant.TaskConstants;
|
||||
@@ -674,9 +675,9 @@ public class WfTaskServiceImpl extends FlowServiceFactory implements IWfTaskServ
|
||||
for (HistoricVariableInstance var : varList) {
|
||||
if ("startTime".equals(var.getVariableName())) {
|
||||
// 若你的流程里存的就是 Date 类型,可以直接转
|
||||
startDate = (Date) var.getValue();
|
||||
startDate = DateUtils.parseDate(var.getValue());
|
||||
} else if ("endTime".equals(var.getVariableName())) {
|
||||
endDate = (Date) var.getValue();
|
||||
endDate = DateUtils.parseDate(var.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,8 +73,9 @@
|
||||
r.role_name,
|
||||
r.role_key
|
||||
from sys_role r
|
||||
join sys_user_role sur on sur.role_id = r.role_id
|
||||
where #{userId} = sur.user_id
|
||||
left join sys_user_role sur on sur.role_id = r.role_id
|
||||
left join sys_user su on su.user_id = sur.user_id
|
||||
where #{userId} = sur.user_id and su.del_flag = '0'
|
||||
</select>
|
||||
<select id="selectTempRoleByName" resultType="Long">
|
||||
select r.role_id from sys_role r where r.role_key = 'temp'
|
||||
|
||||
Reference in New Issue
Block a user