61701-待办中心-项目法规任务、法规评估任务,处理登录人待办标识。
This commit is contained in:
+47
-2
@@ -5,13 +5,14 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.modules.system.enums.SysPermissionEnum;
|
||||
import com.jero.modules.system.mapper.TodoCenterMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.system.util.JwtUtil;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.MD5Util;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
@@ -54,6 +55,9 @@ public class SysPermissionController {
|
||||
@Autowired
|
||||
private ISysDepartPermissionService sysDepartPermissionService;
|
||||
|
||||
@Autowired
|
||||
private TodoCenterMapper todoCenterMapper;
|
||||
|
||||
/**
|
||||
* 加载数据节点
|
||||
*
|
||||
@@ -641,6 +645,47 @@ public class SysPermissionController {
|
||||
if (isWWWHttpUrl(permission.getUrl())) {
|
||||
meta.put("url", permission.getUrl());
|
||||
}
|
||||
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("currentUserId",currentUser.getId());
|
||||
|
||||
List<String> flowTypeList = new ArrayList<>();
|
||||
//项目法规任务
|
||||
if(StringUtils.equals(permission.getId(), SysPermissionEnum.PROJECT_REGULATION_TASKS.getId())){
|
||||
flowTypeList.add("1");
|
||||
flowTypeList.add("2");
|
||||
flowTypeList.add("3");
|
||||
flowTypeList.add("4");
|
||||
flowTypeList.add("10");
|
||||
params.put("flowTypeList",flowTypeList);
|
||||
//存在待办任务标识,true为有
|
||||
boolean existTaskFlag = false;
|
||||
int result = todoCenterMapper.todoCenterTaskCount(params);
|
||||
if(result > 0){
|
||||
existTaskFlag = true;
|
||||
}
|
||||
//查询当前登录用户是否有项目法规任务
|
||||
meta.put("existTask",existTaskFlag);
|
||||
}
|
||||
//法规评估任务
|
||||
if(StringUtils.equals(permission.getId(), SysPermissionEnum.REGULATORY_ASSESSMENT_TASKS.getId())){
|
||||
flowTypeList.add("5");
|
||||
flowTypeList.add("6");
|
||||
params.put("flowTypeList",flowTypeList);
|
||||
int result = todoCenterMapper.todoCenterTaskCount(params);
|
||||
boolean existTaskFlag = false;
|
||||
if(result > 0){
|
||||
existTaskFlag = true;
|
||||
}
|
||||
meta.put("existTask",existTaskFlag);
|
||||
}
|
||||
//项目参数任务
|
||||
if(StringUtils.equals(permission.getId(), SysPermissionEnum.PROJECT_PARAMETER_TASKS.getId())){
|
||||
boolean existTaskFlag = false;
|
||||
meta.put("existTask",existTaskFlag);
|
||||
}
|
||||
json.put("meta", meta);
|
||||
}
|
||||
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.jero.modules.system.enums;
|
||||
|
||||
/**
|
||||
* 菜单权限枚举类
|
||||
* @Author: wzj
|
||||
* @Date: 2022/10/26 16:14
|
||||
**/
|
||||
public enum SysPermissionEnum {
|
||||
|
||||
PROJECT_REGULATION_TASKS("项目法规任务","1580735287309119489",""),
|
||||
REGULATORY_ASSESSMENT_TASKS("法规评估任务","1580735611793059842",""),
|
||||
PROJECT_PARAMETER_TASKS("项目参数任务","1580735965892980738","");
|
||||
|
||||
private String name;
|
||||
private String id;
|
||||
private String value;
|
||||
|
||||
private SysPermissionEnum(String name,String id, String value) {
|
||||
this.name = name;
|
||||
this.id = id;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.system.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 待办中心mapper层
|
||||
* @Author: wzj
|
||||
* @Date: 2022/10/26 16:41
|
||||
**/
|
||||
public interface TodoCenterMapper {
|
||||
int todoCenterTaskCount(@Param("params") Map<String, Object> params);
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.system.mapper.TodoCenterMapper">
|
||||
|
||||
<select id="todoCenterTaskCount" resultType="java.lang.Integer">
|
||||
select
|
||||
count(1)
|
||||
from
|
||||
process_info pi
|
||||
where
|
||||
pi.id in (
|
||||
select detail.process_info_id from process_info_detail detail where detail.status = 'NotDone' and detail.user_id = #{params.currentUserId}
|
||||
)
|
||||
<if test="params.flowTypeList != null ">
|
||||
and pi.flow_type in
|
||||
<foreach collection="params.flowTypeList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user