app试验管理、审查管理、检测报告管理、合格证管理
This commit is contained in:
parent
d2e4193511
commit
104ea80309
|
|
@ -9,6 +9,7 @@ import com.bonus.aqgqj.model.Role;
|
||||||
import com.bonus.aqgqj.system.dao.UserDao;
|
import com.bonus.aqgqj.system.dao.UserDao;
|
||||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||||
import com.bonus.aqgqj.system.vo.Org;
|
import com.bonus.aqgqj.system.vo.Org;
|
||||||
|
import com.bonus.aqgqj.system.vo.SysMenuVo;
|
||||||
import com.bonus.aqgqj.system.vo.UserDto;
|
import com.bonus.aqgqj.system.vo.UserDto;
|
||||||
import com.bonus.aqgqj.model.PasswordConfig;
|
import com.bonus.aqgqj.model.PasswordConfig;
|
||||||
import com.bonus.aqgqj.model.SysUser;
|
import com.bonus.aqgqj.model.SysUser;
|
||||||
|
|
@ -331,4 +332,16 @@ public class UserController {
|
||||||
return ServerResponse.createErroe("操作失败");
|
return ServerResponse.createErroe("操作失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "getRoleAppAuth")
|
||||||
|
@LogAnnotation(operModul = "用户管理", operation = "获取角色App权限", operDesc = "系统级事件",operType="查询")
|
||||||
|
public ServerResponse getRoleAppAuth() {
|
||||||
|
try {
|
||||||
|
List<SysMenuVo> list = userService.getRoleAppAuth();
|
||||||
|
return ServerResponse.createSuccess(list);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.toString(),e);
|
||||||
|
}
|
||||||
|
return ServerResponse.createErroe("操作失败");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.bonus.aqgqj.base.entity.DtreeVo;
|
||||||
import com.bonus.aqgqj.model.Role;
|
import com.bonus.aqgqj.model.Role;
|
||||||
import com.bonus.aqgqj.system.vo.LoginUser;
|
import com.bonus.aqgqj.system.vo.LoginUser;
|
||||||
import com.bonus.aqgqj.system.vo.Org;
|
import com.bonus.aqgqj.system.vo.Org;
|
||||||
|
import com.bonus.aqgqj.system.vo.SysMenuVo;
|
||||||
import com.bonus.aqgqj.system.vo.UserDto;
|
import com.bonus.aqgqj.system.vo.UserDto;
|
||||||
import com.bonus.aqgqj.model.PasswordConfig;
|
import com.bonus.aqgqj.model.PasswordConfig;
|
||||||
import com.bonus.aqgqj.model.SysUser;
|
import com.bonus.aqgqj.model.SysUser;
|
||||||
|
|
@ -168,4 +169,11 @@ public interface UserDao {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Role> getRoleAll();
|
List<Role> getRoleAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色编码查询角色菜单权限
|
||||||
|
* @param roleCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysMenuVo> getRoleAppAuth(String roleCode);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.aqgqj.system.service;
|
||||||
|
|
||||||
import com.bonus.aqgqj.model.Role;
|
import com.bonus.aqgqj.model.Role;
|
||||||
import com.bonus.aqgqj.system.vo.Org;
|
import com.bonus.aqgqj.system.vo.Org;
|
||||||
|
import com.bonus.aqgqj.system.vo.SysMenuVo;
|
||||||
import com.bonus.aqgqj.system.vo.UserDto;
|
import com.bonus.aqgqj.system.vo.UserDto;
|
||||||
import com.bonus.aqgqj.model.PasswordConfig;
|
import com.bonus.aqgqj.model.PasswordConfig;
|
||||||
import com.bonus.aqgqj.model.SysUser;
|
import com.bonus.aqgqj.model.SysUser;
|
||||||
|
|
@ -137,4 +138,10 @@ public interface UserService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Role> getRoleAll();
|
List<Role> getRoleAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询角色下App权限
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysMenuVo> getRoleAppAuth();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.bonus.aqgqj.system.vo.Token;
|
||||||
import com.bonus.aqgqj.system.service.SysLogService;
|
import com.bonus.aqgqj.system.service.SysLogService;
|
||||||
import com.bonus.aqgqj.system.service.TokenService;
|
import com.bonus.aqgqj.system.service.TokenService;
|
||||||
import com.bonus.aqgqj.utils.JwtHelper;
|
import com.bonus.aqgqj.utils.JwtHelper;
|
||||||
|
import com.bonus.aqgqj.utils.UserUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
|
@ -38,8 +39,8 @@ public class TokenServiceImpl implements TokenService {
|
||||||
cacheLoginUser(loginUser);
|
cacheLoginUser(loginUser);
|
||||||
// 登陆日志
|
// 登陆日志
|
||||||
// logService.save(loginUser.getId(), "登陆", true, null);
|
// logService.save(loginUser.getId(), "登陆", true, null);
|
||||||
|
String roleCode= UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getRoleCode() : "";
|
||||||
return new Token(token, loginUser.getLoginTime(),200);
|
return new Token(token, loginUser.getLoginTime(),200,roleCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cacheLoginUser(LoginUser loginUser) {
|
private void cacheLoginUser(LoginUser loginUser) {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.bonus.aqgqj.base.entity.DtreeVo;
|
||||||
import com.bonus.aqgqj.model.Role;
|
import com.bonus.aqgqj.model.Role;
|
||||||
import com.bonus.aqgqj.system.vo.Org;
|
import com.bonus.aqgqj.system.vo.Org;
|
||||||
import com.bonus.aqgqj.model.PasswordConfig;
|
import com.bonus.aqgqj.model.PasswordConfig;
|
||||||
|
import com.bonus.aqgqj.system.vo.SysMenuVo;
|
||||||
import com.bonus.aqgqj.utils.ServerResponse;
|
import com.bonus.aqgqj.utils.ServerResponse;
|
||||||
import com.bonus.aqgqj.utils.StringHelper;
|
import com.bonus.aqgqj.utils.StringHelper;
|
||||||
import com.bonus.aqgqj.utils.UserUtil;
|
import com.bonus.aqgqj.utils.UserUtil;
|
||||||
|
|
@ -222,6 +223,16 @@ public class UserServiceImpl implements UserService {
|
||||||
return userDao.getRoleAll();
|
return userDao.getRoleAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取角色下App权限菜单
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysMenuVo> getRoleAppAuth() {
|
||||||
|
//获取当前登录用户角色编码
|
||||||
|
String roleCode = UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getRoleCode() : "";
|
||||||
|
return userDao.getRoleAppAuth(roleCode);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户
|
* 修改用户
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import lombok.Data;
|
||||||
@Data
|
@Data
|
||||||
public class SysMenuVo {
|
public class SysMenuVo {
|
||||||
|
|
||||||
|
private Integer menuId;
|
||||||
|
|
||||||
private String menuName;//菜單名稱
|
private String menuName;//菜單名稱
|
||||||
|
|
||||||
private String menuUrl;
|
private String menuUrl;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.bonus.aqgqj.system.vo;
|
package com.bonus.aqgqj.system.vo;
|
||||||
|
|
||||||
|
import com.bonus.aqgqj.utils.UserUtil;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -19,11 +21,15 @@ public class Token implements Serializable {
|
||||||
|
|
||||||
private Integer code;
|
private Integer code;
|
||||||
|
|
||||||
public Token(String token, Long loginTime, Integer code) {
|
/** 角色编码 */
|
||||||
|
private String roleCode;
|
||||||
|
|
||||||
|
public Token(String token, Long loginTime, Integer code, String roleCode) {
|
||||||
super();
|
super();
|
||||||
this.token = token;
|
this.token = token;
|
||||||
this.loginTime = loginTime;
|
this.loginTime = loginTime;
|
||||||
this.code = code;
|
this.code = code;
|
||||||
|
this.roleCode = roleCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getToken() {
|
public String getToken() {
|
||||||
|
|
@ -49,4 +55,12 @@ public class Token implements Serializable {
|
||||||
public void setCode(Integer code) {
|
public void setCode(Integer code) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getRoleCode() {
|
||||||
|
return roleCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoleCode(String roleCode) {
|
||||||
|
this.roleCode = roleCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
select
|
select
|
||||||
sum(case when team_id is null then 1 else 0 end ) as dispatchWorkNum
|
sum(case when team_id is null then 1 else 0 end ) as dispatchWorkNum
|
||||||
,sum(case when team_id is not null and process_status is null then 1 else 0 end ) as testNum
|
,sum(case when team_id is not null and process_status is null then 1 else 0 end ) as testNum
|
||||||
,sum(case when process_status='1' and is_er=0 then 1 else 0 end ) as reloadReviewNUm
|
,sum(case when process_status='1' and is_er=1 then 1 else 0 end ) as reloadReviewNUm
|
||||||
,sum(case when process_status='1' and is_er is null and audti_status!='2' then 1 else 0 end ) as reviewNUm
|
,sum(case when process_status='1' and is_er is null and audti_status!='2' then 1 else 0 end ) as reviewNUm
|
||||||
,sum(case when process_status='2' and audti_status!='2' then 1 else 0 end ) as examineNum
|
,sum(case when process_status='2' and audti_status!='2' then 1 else 0 end ) as examineNum
|
||||||
,sum(case when process_status='3' and audti_status!='2' then 1 else 0 end ) as approvalNum
|
,sum(case when process_status='3' and audti_status!='2' then 1 else 0 end ) as approvalNum
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
select
|
select
|
||||||
sum(case when team_id is null then 1 else 0 end ) as dispatchWorkNum
|
sum(case when team_id is null then 1 else 0 end ) as dispatchWorkNum
|
||||||
,sum(case when team_id is not null and process_status is null then 1 else 0 end ) as testNum
|
,sum(case when team_id is not null and process_status is null then 1 else 0 end ) as testNum
|
||||||
,sum(case when process_status='1' and is_er=0 then 1 else 0 end ) as reloadReviewNUm
|
,sum(case when process_status='1' and is_er=1 then 1 else 0 end ) as reloadReviewNUm
|
||||||
,sum(case when process_status='1' and is_er is null and audti_status!='2' then 1 else 0 end ) as reviewNUm
|
,sum(case when process_status='1' and is_er is null and audti_status!='2' then 1 else 0 end ) as reviewNUm
|
||||||
,sum(case when process_status='2' and audti_status!='2' then 1 else 0 end ) as examineNum
|
,sum(case when process_status='2' and audti_status!='2' then 1 else 0 end ) as examineNum
|
||||||
,sum(case when process_status='3' and audti_status!='2' then 1 else 0 end ) as approvalNum
|
,sum(case when process_status='3' and audti_status!='2' then 1 else 0 end ) as approvalNum
|
||||||
|
|
|
||||||
|
|
@ -213,6 +213,25 @@
|
||||||
where t.del_flag = 0
|
where t.del_flag = 0
|
||||||
and t.state = 1
|
and t.state = 1
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getRoleAppAuth" resultType="com.bonus.aqgqj.system.vo.SysMenuVo">
|
||||||
|
SELECT
|
||||||
|
menu_id as menuId,
|
||||||
|
menu_name as menuName
|
||||||
|
FROM
|
||||||
|
sys_menu sm
|
||||||
|
WHERE
|
||||||
|
sm.menu_id IN(
|
||||||
|
SELECT
|
||||||
|
srm.menu_id
|
||||||
|
FROM
|
||||||
|
sys_role sr
|
||||||
|
LEFT JOIN sys_role_menu srm on srm.role_id=sr.role_id
|
||||||
|
WHERE
|
||||||
|
sr.role_code=#{roleCode}
|
||||||
|
)
|
||||||
|
and p_id=192
|
||||||
|
and del_flag=0
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="saveUserRoles">
|
<insert id="saveUserRoles">
|
||||||
insert into sys_role_user(roleId, userId) values
|
insert into sys_role_user(roleId, userId) values
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue