新增公司
This commit is contained in:
parent
508a4bd302
commit
c8f8231ec8
|
|
@ -6,8 +6,10 @@ import com.bonus.common.log.annotation.SysLog;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
import com.bonus.common.security.annotation.InnerAuth;
|
import com.bonus.common.security.annotation.InnerAuth;
|
||||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||||
|
import com.bonus.system.api.domain.SysDept;
|
||||||
import com.bonus.system.api.domain.SysMenu;
|
import com.bonus.system.api.domain.SysMenu;
|
||||||
import com.bonus.system.domain.UserMenuParams;
|
import com.bonus.system.domain.UserMenuParams;
|
||||||
|
import com.bonus.system.service.ISysDeptService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
@ -40,6 +42,9 @@ public class SysMenuController extends BaseController
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysMenuService menuService;
|
private ISysMenuService menuService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前用户的菜单列表
|
* 获取当前用户的菜单列表
|
||||||
*/
|
*/
|
||||||
|
|
@ -199,7 +204,8 @@ public class SysMenuController extends BaseController
|
||||||
try{
|
try{
|
||||||
|
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
UserMenuParams userMenuParams = new UserMenuParams(userId, systemType);
|
SysDept sysDept = deptService.selectDeptById(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||||
|
UserMenuParams userMenuParams = new UserMenuParams(userId, systemType, sysDept.getTemplateId());
|
||||||
List<SysMenu> menus = menuService.selectMenuTreeByUserIdAndSystemType(userMenuParams);
|
List<SysMenu> menus = menuService.selectMenuTreeByUserIdAndSystemType(userMenuParams);
|
||||||
return success(menuService.buildMenus(menus));
|
return success(menuService.buildMenus(menus));
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,14 @@ import lombok.Setter;
|
||||||
public class UserMenuParams {
|
public class UserMenuParams {
|
||||||
private Long userId;
|
private Long userId;
|
||||||
private Long systemType;
|
private Long systemType;
|
||||||
|
private Long templateId;
|
||||||
|
|
||||||
UserMenuParams(){}
|
UserMenuParams(){}
|
||||||
|
|
||||||
public UserMenuParams(Long userId, Long systemType){
|
public UserMenuParams(Long userId, Long systemType, Long templateId){
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.systemType = systemType;
|
this.systemType = systemType;
|
||||||
|
this.templateId = templateId;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,9 +93,11 @@
|
||||||
left join sys_role ro on ur.role_id = ro.role_id
|
left join sys_role ro on ur.role_id = ro.role_id
|
||||||
left join sys_user u on ur.user_id = u.user_id
|
left join sys_user u on ur.user_id = u.user_id
|
||||||
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
|
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
|
||||||
|
<if test="templateId != null">
|
||||||
AND exists (
|
AND exists (
|
||||||
select 0 from sys_template_menu stm where stm.temp_id = #{templateId} and stm.menu_id = m.menu_id
|
select 0 from sys_template_menu stm where stm.temp_id = #{templateId} and stm.menu_id = m.menu_id
|
||||||
)
|
)
|
||||||
|
</if>
|
||||||
order by m.parent_id, m.order_num
|
order by m.parent_id, m.order_num
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -107,6 +109,11 @@
|
||||||
left join sys_role ro on ur.role_id = ro.role_id
|
left join sys_role ro on ur.role_id = ro.role_id
|
||||||
left join sys_user u on ur.user_id = u.user_id
|
left join sys_user u on ur.user_id = u.user_id
|
||||||
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0 AND FIND_IN_SET(#{systemType}, m.system_type)
|
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0 AND FIND_IN_SET(#{systemType}, m.system_type)
|
||||||
|
<if test="templateId != null">
|
||||||
|
AND exists (
|
||||||
|
select 0 from sys_template_menu stm where stm.temp_id = #{templateId} and stm.menu_id = m.menu_id
|
||||||
|
)
|
||||||
|
</if>
|
||||||
order by m.parent_id, m.order_num
|
order by m.parent_id, m.order_num
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue