当前角色问题解决
This commit is contained in:
@@ -230,7 +230,7 @@ public class SysRoleController extends BaseController {
|
|||||||
* 获取当前用户的role对象
|
* 获取当前用户的role对象
|
||||||
*/
|
*/
|
||||||
@GetMapping("/currentRole")
|
@GetMapping("/currentRole")
|
||||||
public R<SysRole> currentRole() {
|
public R<List<SysRole>> currentRole() {
|
||||||
return R.ok(roleService.getCurrentRole());
|
return R.ok(roleService.getCurrentRole());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,4 +85,9 @@ public class SysOaAttendanceVo extends SysOaAttendance {
|
|||||||
|
|
||||||
private Double overTime;
|
private Double overTime;
|
||||||
|
|
||||||
|
// 请假天数
|
||||||
|
private Long absenceDays;
|
||||||
|
|
||||||
|
private Long tripDays;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,6 +120,11 @@ public class OaProgressServiceImpl implements IOaProgressService {
|
|||||||
if(isValid){
|
if(isValid){
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
}
|
}
|
||||||
|
for (Long id : ids) {
|
||||||
|
QueryWrapper<OaProgress> oaProgressQueryWrapper = new QueryWrapper<>();
|
||||||
|
oaProgressQueryWrapper.eq("parent_id", id);
|
||||||
|
baseMapper.delete(oaProgressQueryWrapper);
|
||||||
|
}
|
||||||
return baseMapper.deleteBatchIds(ids) > 0;
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ public class SysOaRemindServiceImpl implements ISysOaRemindService {
|
|||||||
oaProgressBo.setType(1L);
|
oaProgressBo.setType(1L);
|
||||||
List<OaProgressVo> rows1 = progressService.queryPageList(oaProgressBo, pageQuery).getRows();
|
List<OaProgressVo> rows1 = progressService.queryPageList(oaProgressBo, pageQuery).getRows();
|
||||||
for (OaProgressVo row : rows1) {
|
for (OaProgressVo row : rows1) {
|
||||||
if (row.getRemainTime()!=null && row.getRemainTime()<3L){
|
if (row.getRemainTime()!=null && row.getStatus() !=1L && row.getRemainTime()<3L){
|
||||||
SysOaRemindVo sysOaRemindVo = new SysOaRemindVo();
|
SysOaRemindVo sysOaRemindVo = new SysOaRemindVo();
|
||||||
sysOaRemindVo.setType("progress-project");
|
sysOaRemindVo.setType("progress-project");
|
||||||
sysOaRemindVo.setContent(row.getProgressName());
|
sysOaRemindVo.setContent(row.getProgressName());
|
||||||
|
|||||||
@@ -97,50 +97,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
|
|
||||||
<select id="selectVoListAndTime" resultType="com.ruoyi.oa.domain.vo.SysOaAttendanceVo">
|
<select id="selectVoListAndTime" resultType="com.ruoyi.oa.domain.vo.SysOaAttendanceVo">
|
||||||
SELECT
|
SELECT ANY_VALUE(id) AS id,
|
||||||
ANY_VALUE(id) AS id,
|
user_id,
|
||||||
user_id,
|
ANY_VALUE(attendance_day) AS attendance_day,
|
||||||
ANY_VALUE(attendance_day) AS attendance_day,
|
project_id,
|
||||||
project_id,
|
ANY_VALUE(day_length) AS day_length,
|
||||||
ANY_VALUE(day_length) AS day_length,
|
ANY_VALUE(hour) AS hour,
|
||||||
ANY_VALUE(hour) AS hour,
|
ANY_VALUE(create_time) AS create_time,
|
||||||
ANY_VALUE(create_time) AS create_time,
|
ANY_VALUE(create_by) AS create_by,
|
||||||
ANY_VALUE(create_by) AS create_by,
|
ANY_VALUE(update_time) AS update_time,
|
||||||
ANY_VALUE(update_time) AS update_time,
|
ANY_VALUE(update_by) AS update_by,
|
||||||
ANY_VALUE(update_by) AS update_by,
|
ANY_VALUE(remark) AS remark,
|
||||||
ANY_VALUE(remark) AS remark,
|
ANY_VALUE(del_flag) AS del_flag,
|
||||||
ANY_VALUE(del_flag) AS del_flag,
|
COUNT(id) AS count,
|
||||||
COUNT(id) AS count,
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
1)如果这条记录是按天统计 (day_length>0),就直接用 day_length。
|
1)如果这条记录是按天统计 (day_length>0),就直接用 day_length。
|
||||||
2)如果这条记录是按小时统计 (hour>0),那么就算作 1 天。
|
2)如果这条记录是按小时统计 (hour>0),那么就算作 1 天。
|
||||||
这样就不会把多日的小时相加再去整除 9。
|
这样就不会把多日的小时相加再去整除 8。
|
||||||
*/
|
*/
|
||||||
SUM(
|
SUM(
|
||||||
CASE
|
CASE
|
||||||
WHEN day_length > 0 THEN day_length
|
WHEN day_length > 0 THEN day_length
|
||||||
WHEN hour > 0 THEN 1
|
WHEN hour > 0 THEN ROUND(hour / 8, 1)
|
||||||
ELSE 0
|
ELSE 0
|
||||||
END
|
END
|
||||||
) AS work_times,
|
) AS work_times,
|
||||||
SUM(
|
SUM(
|
||||||
CASE
|
CASE
|
||||||
WHEN day_length > 0 THEN day_length
|
WHEN day_length > 0 THEN day_length * 8
|
||||||
WHEN hour > 0 THEN 1
|
WHEN hour > 0 THEN hour
|
||||||
ELSE 0
|
ELSE 0
|
||||||
END
|
END
|
||||||
) *9 AS hour_work_times,
|
) AS hour_work_times,
|
||||||
/*
|
/*
|
||||||
overTime:如果是按小时统计,且 hour>9,才有加班 = (hour - 9)。
|
overTime:如果是按小时统计,且 hour>8,才有加班 = (hour - 8)。
|
||||||
如果是 day_length 统计,则一般不会再去算小时加班(你如果有需要,也可以自己按其它规则)。
|
如果是 day_length 统计,则一般不会再去算小时加班(你如果有需要,也可以自己按其它规则)。
|
||||||
*/
|
*/
|
||||||
SUM(
|
SUM(
|
||||||
CASE
|
IF(hour > 8, hour - 8, 0)
|
||||||
WHEN hour > 9 THEN hour - 9
|
) AS overTime,
|
||||||
ELSE 0
|
|
||||||
END
|
/* ---------- 出差天数 (project_id = 0) ---------- */
|
||||||
) AS overTime
|
SUM(
|
||||||
|
IF(project_id = 0, 1, 0)
|
||||||
|
) AS tripDays,
|
||||||
|
|
||||||
|
/* ---------- 请假天数 (project_id = 1) ---------- */
|
||||||
|
SUM(
|
||||||
|
IF(project_id = 1, 1, 0)
|
||||||
|
) AS absenceDays
|
||||||
|
|
||||||
FROM sys_oa_attendance soa
|
FROM sys_oa_attendance soa
|
||||||
WHERE user_id = #{userId}
|
WHERE user_id = #{userId}
|
||||||
@@ -149,7 +155,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
AND del_flag = '0'
|
AND del_flag = '0'
|
||||||
GROUP BY soa.project_id;
|
GROUP BY soa.project_id;
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectUserListAndAttendanceListAndProjectListByUserIds"
|
<select id="selectUserListAndAttendanceListAndProjectListByUserIds"
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public interface SysRoleMapper extends BaseMapperPlus<SysRoleMapper, SysRole, Sy
|
|||||||
* @param userId
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
SysRole getCurrentRole(Long userId);
|
List<SysRole> getCurrentRole(Long userId);
|
||||||
|
|
||||||
Long[] selectTempRoleByName();
|
Long[] selectTempRoleByName();
|
||||||
|
|
||||||
|
|||||||
@@ -186,6 +186,6 @@ public interface ISysRoleService {
|
|||||||
Long[] selectTempRoleByName();
|
Long[] selectTempRoleByName();
|
||||||
|
|
||||||
|
|
||||||
SysRole getCurrentRole();
|
List<SysRole> getCurrentRole();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -448,7 +448,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SysRole getCurrentRole() {
|
public List<SysRole> getCurrentRole() {
|
||||||
|
|
||||||
return baseMapper.getCurrentRole(LoginHelper.getUserId());
|
return baseMapper.getCurrentRole(LoginHelper.getUserId());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -590,12 +590,10 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
|||||||
.processInstanceId(histTask.getProcessInstanceId())
|
.processInstanceId(histTask.getProcessInstanceId())
|
||||||
.singleResult();
|
.singleResult();
|
||||||
Long userId = Long.parseLong(historicProcessInstance.getStartUserId());
|
Long userId = Long.parseLong(historicProcessInstance.getStartUserId());
|
||||||
String nickName = userService.selectNickNameById(userId);
|
SysUser sysUser = sysUserService.selectUserByIdAndNotDelFlag(userId);
|
||||||
flowTask.setStartUserId(userId);
|
flowTask.setStartUserId(sysUser.getUserId());
|
||||||
flowTask.setStartUserName(nickName);
|
flowTask.setStartUserName(sysUser.getNickName());
|
||||||
|
|
||||||
//获取部门信息(新增于2024年2月29日)
|
//获取部门信息(新增于2024年2月29日)
|
||||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
|
||||||
if (sysUser.getDeptId()!=null){
|
if (sysUser.getDeptId()!=null){
|
||||||
SysDept sysDept = sysDeptService.selectDeptById(sysUser.getDeptId());
|
SysDept sysDept = sysDeptService.selectDeptById(sysUser.getDeptId());
|
||||||
flowTask.setDeptName(sysDept.getDeptName());
|
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.core.service.UserService;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.helper.LoginHelper;
|
import com.ruoyi.common.helper.LoginHelper;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.flowable.common.constant.ProcessConstants;
|
import com.ruoyi.flowable.common.constant.ProcessConstants;
|
||||||
import com.ruoyi.flowable.common.constant.TaskConstants;
|
import com.ruoyi.flowable.common.constant.TaskConstants;
|
||||||
@@ -674,9 +675,9 @@ public class WfTaskServiceImpl extends FlowServiceFactory implements IWfTaskServ
|
|||||||
for (HistoricVariableInstance var : varList) {
|
for (HistoricVariableInstance var : varList) {
|
||||||
if ("startTime".equals(var.getVariableName())) {
|
if ("startTime".equals(var.getVariableName())) {
|
||||||
// 若你的流程里存的就是 Date 类型,可以直接转
|
// 若你的流程里存的就是 Date 类型,可以直接转
|
||||||
startDate = (Date) var.getValue();
|
startDate = DateUtils.parseDate(var.getValue());
|
||||||
} else if ("endTime".equals(var.getVariableName())) {
|
} else if ("endTime".equals(var.getVariableName())) {
|
||||||
endDate = (Date) var.getValue();
|
endDate = DateUtils.parseDate(var.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,8 +73,9 @@
|
|||||||
r.role_name,
|
r.role_name,
|
||||||
r.role_key
|
r.role_key
|
||||||
from sys_role r
|
from sys_role r
|
||||||
join sys_user_role sur on sur.role_id = r.role_id
|
left join sys_user_role sur on sur.role_id = r.role_id
|
||||||
where #{userId} = sur.user_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>
|
||||||
<select id="selectTempRoleByName" resultType="Long">
|
<select id="selectTempRoleByName" resultType="Long">
|
||||||
select r.role_id from sys_role r where r.role_key = 'temp'
|
select r.role_id from sys_role r where r.role_key = 'temp'
|
||||||
|
|||||||
10
script/minio/script
Normal file
10
script/minio/script
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
docker run \
|
||||||
|
--name minio \
|
||||||
|
-p 11295:9000 \
|
||||||
|
-p 11296:9090 \
|
||||||
|
-d \
|
||||||
|
-e "MINIO_ROOT_USER=minio" \
|
||||||
|
-e "MINIO_ROOT_PASSWORD=minio123" \
|
||||||
|
-v /home/userroot/minio-data:/data \
|
||||||
|
-v /home/userroot/minio-config:/root/.minio \
|
||||||
|
minio/minio server /data --console-address ":9090" --address ":9000"
|
||||||
Reference in New Issue
Block a user