Commit a0408817 by guojuxing

添加仅超管可用标志字段

parent e5a48c43
......@@ -3,6 +3,7 @@ package com.gic.auth.dao.mapper;
import com.gic.auth.dto.AuthItemListDTO;
import com.gic.auth.dto.MenuDTO;
import com.gic.auth.entity.TabSysMenu;
import com.gic.auth.entity.TabSysUser;
import com.gic.auth.qo.MenuListQO;
import com.gic.auth.qo.MenuOperationItemListQO;
import org.apache.ibatis.annotations.Param;
......@@ -166,4 +167,13 @@ public interface TabSysMenuMapper {
* @return void


 */
void updateParentCodeByParentId(@Param("parentId")Integer parentId, @Param("parentCode") String parentCode);
/**
* 仅超管可用的操作项
* @Title: listAdminOnlyOperationItem

* @Description:

 * @author guojuxing 

* @return java.util.List<com.gic.auth.entity.TabSysUser>


 */
List<TabSysUser> listAdminOnlyOperationItem();
}
\ No newline at end of file
......@@ -92,10 +92,20 @@ public class TabSysMenu {
private Integer menuType;
/**
* 应用版本名称
* 应用版本名称 基础版/高级版
*/
private String menuVersionName;
/**
* 前端使用:二级域名,也就是项目的部署路径,比如门店项目部署在/damo-store下面,那么就是/damo-store
*/
private String projectUrlForWeb;
/**
* 操作项 ,仅超管可用 1:是 0:否
*/
private Integer adminOnlySign;
public Integer getMenuId() {
return menuId;
}
......@@ -239,4 +249,20 @@ public class TabSysMenu {
public void setMenuVersionName(String menuVersionName) {
this.menuVersionName = menuVersionName;
}
public String getProjectUrlForWeb() {
return projectUrlForWeb;
}
public void setProjectUrlForWeb(String projectUrlForWeb) {
this.projectUrlForWeb = projectUrlForWeb;
}
public Integer getAdminOnlySign() {
return adminOnlySign;
}
public void setAdminOnlySign(Integer adminOnlySign) {
this.adminOnlySign = adminOnlySign;
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ package com.gic.auth.service;
import com.gic.auth.dto.AuthItemListDTO;
import com.gic.auth.dto.MenuDTO;
import com.gic.auth.entity.TabSysMenu;
import com.gic.auth.entity.TabSysUser;
import com.gic.auth.qo.MenuListQO;
import com.gic.auth.qo.MenuOperationItemListQO;
import com.github.pagehelper.Page;
......@@ -144,4 +145,13 @@ public interface MenuService {
* @return void


 */
void updateParentCodeByParentId(Integer parentId, String parentCode);
/**
* 查询仅超管可用的操作项
* @Title: listAdminOnlyOperationItem

* @Description:

 * @author guojuxing 

* @return java.util.List<com.gic.auth.entity.TabSysUser>


 */
List<TabSysUser> listAdminOnlyOperationItem();
}
......@@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List;
import com.gic.auth.dto.AuthItemListDTO;
import com.gic.auth.entity.TabSysUser;
import com.gic.auth.qo.MenuOperationItemListQO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
......@@ -144,6 +145,11 @@ public class MenuServiceImpl implements MenuService {
tabSysMenuMapper.updateParentCodeByParentId(parentId, parentCode);
}
@Override
public List<TabSysUser> listAdminOnlyOperationItem() {
return tabSysMenuMapper.listAdminOnlyOperationItem();
}
private void updateSort(Integer sort, Integer id) {
TabSysMenu record = new TabSysMenu();
record.setMenuId(id);
......
......@@ -264,7 +264,9 @@ public class MenuApiServiceImpl implements MenuApiService {
menuDTO.setMenuType(MenuTypeEnum.OPERATION.getCode());
ServiceResponse<Integer> saveOperationItemResult = saveChildPage(menuDTO, MenuDTO.SaveOperationItemValid.class);
if (saveOperationItemResult.isSuccess()) {
if (menuDTO.isNeedCreateAuthItem()) {
if (menuDTO.getAdminOnlySign() != null && menuDTO.getAdminOnlySign().intValue() == MenuOperationItemConstants.ADMIN_ONLY) {
//如果是仅超管可用,则不同步生成权限项
} else if (menuDTO.isNeedCreateAuthItem()) {
//同步生成权限项
AuthItemSaveQO authItemSaveQO = new AuthItemSaveQO();
authItemSaveQO.setMenuName(menuDTO.getMenuName());
......@@ -898,6 +900,8 @@ public class MenuApiServiceImpl implements MenuApiService {
resultList.add(menuDTO);
}
}
List<TabSysUser> adminOnlyOperationItemList = menuService.listAdminOnlyOperationItem();
resultList.addAll(EntityUtil.changeEntityListNew(MenuDTO.class, adminOnlyOperationItemList));
return ServiceResponse.success(resultList);
}
}
......@@ -20,10 +20,13 @@
<result column="menu_version" jdbcType="VARCHAR" property="menuVersion" />
<result column="menu_type" jdbcType="INTEGER" property="menuType" />
<result column="menu_version_name" jdbcType="VARCHAR" property="menuVersionName" />
<result column="project_url_for_web" jdbcType="VARCHAR" property="projectUrlForWeb" />
<result column="admin_only_sign" jdbcType="INTEGER" property="adminOnlySign" />
</resultMap>
<sql id="Base_Column_List">
menu_id, menu_name, project, menu_url, parent_id, target, icon_url, sort, status,
create_time, update_time, level, is_show, menu_code, parent_code, menu_version, menu_type, menu_version_name
create_time, update_time, level, is_show, menu_code, parent_code, menu_version, menu_type,
menu_version_name, project_url_for_web, admin_only_sign
</sql>
<sql id="tree_filter">
and menu_type != 2
......@@ -53,15 +56,17 @@
icon_url, sort, status,
create_time, update_time, level,
is_show, menu_code, parent_code,
menu_version, menu_type, menu_version_name)
menu_version, menu_type, menu_version_name,
project_url_for_web, admin_only_sign)
values (#{menuId,jdbcType=INTEGER}, #{menuName,jdbcType=VARCHAR}, #{project,jdbcType=VARCHAR},
#{menuUrl,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{target,jdbcType=INTEGER},
#{iconUrl,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{level,jdbcType=INTEGER},
#{isShow,jdbcType=INTEGER}, #{menuCode,jdbcType=VARCHAR}, #{parentCode,jdbcType=VARCHAR},
#{menuVersion,jdbcType=VARCHAR}, #{menuType,jdbcType=INTEGER}, #{menuVersionName,jdbcType=VARCHAR})
#{menuVersion,jdbcType=VARCHAR}, #{menuType,jdbcType=INTEGER}, #{menuVersionName,jdbcType=VARCHAR},
#{projectUrlForWeb,jdbcType=VARCHAR}, #{adminOnlySign,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysMenu" useGeneratedKeys="true" keyProperty="menuId">
<insert id="insertSelective" keyProperty="menuId" parameterType="com.gic.auth.entity.TabSysMenu" useGeneratedKeys="true">
insert into tab_sys_menu
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="menuId != null">
......@@ -118,6 +123,12 @@
<if test="menuVersionName != null">
menu_version_name,
</if>
<if test="projectUrlForWeb != null">
project_url_for_web,
</if>
<if test="adminOnlySign != null">
admin_only_sign,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="menuId != null">
......@@ -174,6 +185,12 @@
<if test="menuVersionName != null">
#{menuVersionName,jdbcType=VARCHAR},
</if>
<if test="projectUrlForWeb != null">
#{projectUrlForWeb,jdbcType=VARCHAR},
</if>
<if test="adminOnlySign != null">
#{adminOnlySign,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.auth.entity.TabSysMenu">
......@@ -230,6 +247,12 @@
<if test="menuVersionName != null">
menu_version_name = #{menuVersionName,jdbcType=VARCHAR},
</if>
<if test="projectUrlForWeb != null">
project_url_for_web = #{projectUrlForWeb,jdbcType=VARCHAR},
</if>
<if test="adminOnlySign != null">
admin_only_sign = #{adminOnlySign,jdbcType=INTEGER},
</if>
</set>
where menu_id = #{menuId,jdbcType=INTEGER}
</update>
......@@ -251,11 +274,13 @@
parent_code = #{parentCode,jdbcType=VARCHAR},
menu_version = #{menuVersion,jdbcType=VARCHAR},
menu_type = #{menuType,jdbcType=INTEGER},
menu_version_name = #{menuVersionName,jdbcType=VARCHAR}
menu_version_name = #{menuVersionName,jdbcType=VARCHAR},
project_url_for_web = #{projectUrlForWeb,jdbcType=VARCHAR},
admin_only_sign = #{adminOnlySign,jdbcType=INTEGER}
where menu_id = #{menuId,jdbcType=INTEGER}
</update>
<select id="listMenu" resultMap="BaseResultMap" parameterType="com.gic.auth.qo.MenuListQO">
<select id="listMenu" parameterType="com.gic.auth.qo.MenuListQO" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_menu
......@@ -314,7 +339,7 @@
order by sort
</select>
<select id="pageMenuOperationItem" resultMap="BaseResultMap" parameterType="com.gic.auth.qo.MenuOperationItemListQO">
<select id="pageMenuOperationItem" parameterType="com.gic.auth.qo.MenuOperationItemListQO" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_menu
......@@ -337,9 +362,9 @@
<include refid="Base_Column_List" />
from tab_sys_menu
where status=1
<if test="null != menuIdList and menuIdList.size() > 0">
<if test="null != menuIdList and menuIdList.size() &gt; 0">
and menu_id in
<foreach collection="menuIdList" index="index" item="item" open="(" separator="," close=")">
<foreach close=")" collection="menuIdList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
......@@ -353,7 +378,7 @@
from tab_sys_menu a
where a.status=1
and a.parent_id = #{menuId}
<include refid="role_filter"></include>
<include refid="role_filter" />
</select>
......@@ -373,7 +398,7 @@
<if test="project != null">
and project = #{project}
</if>
<include refid="tree_filter"></include>
<include refid="tree_filter" />
order by level,sort
</select>
......@@ -385,10 +410,10 @@
from tab_sys_menu
where status=1
and project != 'gic'
<include refid="tree_filter"></include>
<if test="null != projectList and projectList.size() > 0">
<include refid="tree_filter" />
<if test="null != projectList and projectList.size() &gt; 0">
and project in
<foreach collection="projectList" index="index" item="item" open="(" separator="," close=")">
<foreach close=")" collection="projectList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
......@@ -409,4 +434,13 @@
where parent_id = #{parentId}
and status = 1
</update>
<select id="listAdminOnlyOperationItem" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_menu
where status = 1
and admin_only_sign = 1
and menu_type = 2
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment