提交代码
parent
a9d0d7ad46
commit
10f6cad6cb
|
@ -5,11 +5,13 @@ import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单配置对象 wx_menu_config
|
* 菜单配置对象 wx_menu_config
|
||||||
*
|
*
|
||||||
* @author JiangYuQi
|
* @author JiangYuQi
|
||||||
* @date 2024-12-29
|
* @date 2025-03-09
|
||||||
*/
|
*/
|
||||||
public class WxMenuConfig extends BaseEntity
|
public class WxMenuConfig extends BaseEntity
|
||||||
{
|
{
|
||||||
|
@ -49,6 +51,9 @@ public class WxMenuConfig extends BaseEntity
|
||||||
@Excel(name = "菜单类型")
|
@Excel(name = "菜单类型")
|
||||||
private String menuType;
|
private String menuType;
|
||||||
|
|
||||||
|
/** 菜单配置角色信息 */
|
||||||
|
private List<WxMenuConfigRole> wxMenuConfigRoleList;
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -131,6 +136,16 @@ public class WxMenuConfig extends BaseEntity
|
||||||
return menuType;
|
return menuType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<WxMenuConfigRole> getWxMenuConfigRoleList()
|
||||||
|
{
|
||||||
|
return wxMenuConfigRoleList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWxMenuConfigRoleList(List<WxMenuConfigRole> wxMenuConfigRoleList)
|
||||||
|
{
|
||||||
|
this.wxMenuConfigRoleList = wxMenuConfigRoleList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
@ -144,6 +159,7 @@ public class WxMenuConfig extends BaseEntity
|
||||||
.append("menuSort", getMenuSort())
|
.append("menuSort", getMenuSort())
|
||||||
.append("createTime", getCreateTime())
|
.append("createTime", getCreateTime())
|
||||||
.append("menuType", getMenuType())
|
.append("menuType", getMenuType())
|
||||||
|
.append("wxMenuConfigRoleList", getWxMenuConfigRoleList())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
* 菜单配置角色对象 wx_menu_config_role
|
* 菜单配置角色对象 wx_menu_config_role
|
||||||
*
|
*
|
||||||
* @author JiangYuQi
|
* @author JiangYuQi
|
||||||
* @date 2024-12-29
|
* @date 2025-03-09
|
||||||
*/
|
*/
|
||||||
public class WxMenuConfigRole extends BaseEntity
|
public class WxMenuConfigRole extends BaseEntity
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,12 +2,13 @@ package com.yanzhu.manage.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.yanzhu.manage.domain.WxMenuConfig;
|
import com.yanzhu.manage.domain.WxMenuConfig;
|
||||||
|
import com.yanzhu.manage.domain.WxMenuConfigRole;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单配置Mapper接口
|
* 菜单配置Mapper接口
|
||||||
*
|
*
|
||||||
* @author JiangYuQi
|
* @author JiangYuQi
|
||||||
* @date 2024-12-29
|
* @date 2025-03-09
|
||||||
*/
|
*/
|
||||||
public interface WxMenuConfigMapper
|
public interface WxMenuConfigMapper
|
||||||
{
|
{
|
||||||
|
@ -59,6 +60,31 @@ public interface WxMenuConfigMapper
|
||||||
*/
|
*/
|
||||||
public int deleteWxMenuConfigByIds(Long[] ids);
|
public int deleteWxMenuConfigByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除菜单配置角色
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteWxMenuConfigRoleBySmcids(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增菜单配置角色
|
||||||
|
*
|
||||||
|
* @param wxMenuConfigRoleList 菜单配置角色列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int batchWxMenuConfigRole(List<WxMenuConfigRole> wxMenuConfigRoleList);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过菜单配置主键删除菜单配置角色信息
|
||||||
|
*
|
||||||
|
* @param id 菜单配置ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteWxMenuConfigRoleBySmcid(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询微信用户菜单
|
* 查询微信用户菜单
|
||||||
*
|
*
|
||||||
|
@ -66,5 +92,4 @@ public interface WxMenuConfigMapper
|
||||||
* @return 菜单配置集合
|
* @return 菜单配置集合
|
||||||
*/
|
*/
|
||||||
public List<WxMenuConfig> findUserMenuList(WxMenuConfig wxMenuConfig);
|
public List<WxMenuConfig> findUserMenuList(WxMenuConfig wxMenuConfig);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
package com.yanzhu.manage.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.yanzhu.manage.domain.WxMenuConfigRole;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单配置角色Mapper接口
|
|
||||||
*
|
|
||||||
* @author JiangYuQi
|
|
||||||
* @date 2024-12-29
|
|
||||||
*/
|
|
||||||
public interface WxMenuConfigRoleMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询菜单配置角色
|
|
||||||
*
|
|
||||||
* @param smcid 菜单配置角色主键
|
|
||||||
* @return 菜单配置角色
|
|
||||||
*/
|
|
||||||
public WxMenuConfigRole selectWxMenuConfigRoleBySmcid(Long smcid);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询菜单配置角色列表
|
|
||||||
*
|
|
||||||
* @param wxMenuConfigRole 菜单配置角色
|
|
||||||
* @return 菜单配置角色集合
|
|
||||||
*/
|
|
||||||
public List<WxMenuConfigRole> selectWxMenuConfigRoleList(WxMenuConfigRole wxMenuConfigRole);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增菜单配置角色
|
|
||||||
*
|
|
||||||
* @param wxMenuConfigRole 菜单配置角色
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertWxMenuConfigRole(WxMenuConfigRole wxMenuConfigRole);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改菜单配置角色
|
|
||||||
*
|
|
||||||
* @param wxMenuConfigRole 菜单配置角色
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateWxMenuConfigRole(WxMenuConfigRole wxMenuConfigRole);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除菜单配置角色
|
|
||||||
*
|
|
||||||
* @param smcid 菜单配置角色主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteWxMenuConfigRoleBySmcid(Long smcid);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除菜单配置角色
|
|
||||||
*
|
|
||||||
* @param smcids 需要删除的数据主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteWxMenuConfigRoleBySmcids(Long[] smcids);
|
|
||||||
}
|
|
|
@ -17,6 +17,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="menuType" column="menu_type" />
|
<result property="menuType" column="menu_type" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="WxMenuConfigWxMenuConfigRoleResult" type="WxMenuConfig" extends="WxMenuConfigResult">
|
||||||
|
<collection property="wxMenuConfigRoleList" notNullColumn="sub_smcid" javaType="java.util.List" resultMap="WxMenuConfigRoleResult" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="WxMenuConfigRole" id="WxMenuConfigRoleResult">
|
||||||
|
<result property="smcid" column="sub_smcid" />
|
||||||
|
<result property="roleId" column="sub_role_id" />
|
||||||
|
<result property="userId" column="sub_user_id" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectWxMenuConfigVo">
|
<sql id="selectWxMenuConfigVo">
|
||||||
select id, project_id, menu_name, menu_identi, menu_img, menu_url, del_flag, menu_sort, create_time, menu_type from wx_menu_config
|
select id, project_id, menu_name, menu_identi, menu_img, menu_url, del_flag, menu_sort, create_time, menu_type from wx_menu_config
|
||||||
</sql>
|
</sql>
|
||||||
|
@ -27,14 +37,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||||
<if test="menuName != null and menuName != ''"> and menu_name like concat('%', #{menuName}, '%')</if>
|
<if test="menuName != null and menuName != ''"> and menu_name like concat('%', #{menuName}, '%')</if>
|
||||||
<if test="menuType != null and menuType != ''"> and menu_type = #{menuType}</if>
|
<if test="menuType != null and menuType != ''"> and menu_type = #{menuType}</if>
|
||||||
<if test='activeTags == "sys"'> and project_id is null </if>
|
|
||||||
and del_flag = 0
|
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectWxMenuConfigById" parameterType="Long" resultMap="WxMenuConfigResult">
|
<select id="selectWxMenuConfigById" parameterType="Long" resultMap="WxMenuConfigWxMenuConfigRoleResult">
|
||||||
<include refid="selectWxMenuConfigVo"/>
|
select a.id, a.project_id, a.menu_name, a.menu_identi, a.menu_img, a.menu_url, a.del_flag, a.menu_sort, a.create_time, a.menu_type,
|
||||||
where id = #{id}
|
b.smcid as sub_smcid, b.role_id as sub_role_id, b.user_id as sub_user_id
|
||||||
|
from wx_menu_config a
|
||||||
|
left join wx_menu_config_role b on b.smcid = a.id
|
||||||
|
where a.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertWxMenuConfig" parameterType="WxMenuConfig" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertWxMenuConfig" parameterType="WxMenuConfig" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
@ -89,6 +100,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteWxMenuConfigRoleBySmcids" parameterType="String">
|
||||||
|
delete from wx_menu_config_role where smcid in
|
||||||
|
<foreach item="smcid" collection="array" open="(" separator="," close=")">
|
||||||
|
#{smcid}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteWxMenuConfigRoleBySmcid" parameterType="Long">
|
||||||
|
delete from wx_menu_config_role where smcid = #{smcid}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="batchWxMenuConfigRole">
|
||||||
|
insert into wx_menu_config_role( smcid, role_id, user_id) values
|
||||||
|
<foreach item="item" index="index" collection="list" separator=",">
|
||||||
|
( #{item.smcid}, #{item.roleId}, #{item.userId})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<!--查询角色相关菜单-->
|
<!--查询角色相关菜单-->
|
||||||
<select id="findUserMenuList" parameterType="WxMenuConfig" resultMap="WxMenuConfigResult">
|
<select id="findUserMenuList" parameterType="WxMenuConfig" resultMap="WxMenuConfigResult">
|
||||||
|
|
|
@ -1,65 +0,0 @@
|
||||||
<?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.yanzhu.manage.mapper.WxMenuConfigRoleMapper">
|
|
||||||
|
|
||||||
<resultMap type="WxMenuConfigRole" id="WxMenuConfigRoleResult">
|
|
||||||
<result property="smcid" column="smcid" />
|
|
||||||
<result property="roleId" column="role_id" />
|
|
||||||
<result property="userId" column="user_id" />
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="selectWxMenuConfigRoleVo">
|
|
||||||
select smcid, role_id, user_id from wx_menu_config_role
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<select id="selectWxMenuConfigRoleList" parameterType="WxMenuConfigRole" resultMap="WxMenuConfigRoleResult">
|
|
||||||
<include refid="selectWxMenuConfigRoleVo"/>
|
|
||||||
<where>
|
|
||||||
<if test="smcid != null "> and smcid = #{smcid}</if>
|
|
||||||
<if test="roleId != null "> and role_id = #{roleId}</if>
|
|
||||||
<if test="userId != null "> and user_id = #{userId}</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectWxMenuConfigRoleBySmcid" parameterType="Long" resultMap="WxMenuConfigRoleResult">
|
|
||||||
<include refid="selectWxMenuConfigRoleVo"/>
|
|
||||||
where smcid = #{smcid}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="insertWxMenuConfigRole" parameterType="WxMenuConfigRole">
|
|
||||||
insert into wx_menu_config_role
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="smcid != null">smcid,</if>
|
|
||||||
<if test="roleId != null">role_id,</if>
|
|
||||||
<if test="userId != null">user_id,</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="smcid != null">#{smcid},</if>
|
|
||||||
<if test="roleId != null">#{roleId},</if>
|
|
||||||
<if test="userId != null">#{userId},</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="updateWxMenuConfigRole" parameterType="WxMenuConfigRole">
|
|
||||||
update wx_menu_config_role
|
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
|
||||||
<if test="roleId != null">role_id = #{roleId},</if>
|
|
||||||
<if test="userId != null">user_id = #{userId},</if>
|
|
||||||
</trim>
|
|
||||||
where smcid = #{smcid}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="deleteWxMenuConfigRoleBySmcid" parameterType="Long">
|
|
||||||
delete from wx_menu_config_role where smcid = #{smcid}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<delete id="deleteWxMenuConfigRoleBySmcids" parameterType="String">
|
|
||||||
delete from wx_menu_config_role where smcid in
|
|
||||||
<foreach item="smcid" collection="array" open="(" separator="," close=")">
|
|
||||||
#{smcid}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
</mapper>
|
|
|
@ -0,0 +1,98 @@
|
||||||
|
package com.yanzhu.manage.controller;
|
||||||
|
|
||||||
|
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||||
|
import com.yanzhu.common.core.web.controller.BaseController;
|
||||||
|
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||||
|
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||||
|
import com.yanzhu.common.log.annotation.Log;
|
||||||
|
import com.yanzhu.common.log.enums.BusinessType;
|
||||||
|
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.yanzhu.manage.domain.WxMenuConfig;
|
||||||
|
import com.yanzhu.manage.service.IWxMenuConfigService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单配置Controller
|
||||||
|
*
|
||||||
|
* @author JiangYuQi
|
||||||
|
* @date 2025-03-09
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wxMenuConfig")
|
||||||
|
public class WxMenuConfigController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IWxMenuConfigService wxMenuConfigService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询菜单配置列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:wxMenuConfig:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(WxMenuConfig wxMenuConfig)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<WxMenuConfig> list = wxMenuConfigService.selectWxMenuConfigList(wxMenuConfig);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出菜单配置列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:wxMenuConfig:export")
|
||||||
|
@Log(title = "菜单配置", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, WxMenuConfig wxMenuConfig)
|
||||||
|
{
|
||||||
|
List<WxMenuConfig> list = wxMenuConfigService.selectWxMenuConfigList(wxMenuConfig);
|
||||||
|
ExcelUtil<WxMenuConfig> util = new ExcelUtil<WxMenuConfig>(WxMenuConfig.class);
|
||||||
|
util.exportExcel(response, list, "菜单配置数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取菜单配置详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:wxMenuConfig:query")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(wxMenuConfigService.selectWxMenuConfigById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增菜单配置
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:wxMenuConfig:add")
|
||||||
|
@Log(title = "菜单配置", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody WxMenuConfig wxMenuConfig)
|
||||||
|
{
|
||||||
|
return toAjax(wxMenuConfigService.insertWxMenuConfig(wxMenuConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改菜单配置
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:wxMenuConfig:edit")
|
||||||
|
@Log(title = "菜单配置", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody WxMenuConfig wxMenuConfig)
|
||||||
|
{
|
||||||
|
return toAjax(wxMenuConfigService.updateWxMenuConfig(wxMenuConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除菜单配置
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:wxMenuConfig:remove")
|
||||||
|
@Log(title = "菜单配置", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(wxMenuConfigService.deleteWxMenuConfigByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,7 +6,6 @@ import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||||
import com.yanzhu.common.redis.service.RedisService;
|
import com.yanzhu.common.redis.service.RedisService;
|
||||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||||
import com.yanzhu.manage.domain.WxMenuConfig;
|
import com.yanzhu.manage.domain.WxMenuConfig;
|
||||||
import com.yanzhu.manage.service.IWxMenuConfigService;
|
|
||||||
import com.yanzhu.system.api.domain.SysUser;
|
import com.yanzhu.system.api.domain.SysUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
package com.yanzhu.manage.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.yanzhu.manage.domain.WxMenuConfigRole;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单配置角色Service接口
|
|
||||||
*
|
|
||||||
* @author JiangYuQi
|
|
||||||
* @date 2024-12-29
|
|
||||||
*/
|
|
||||||
public interface IWxMenuConfigRoleService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询菜单配置角色
|
|
||||||
*
|
|
||||||
* @param smcid 菜单配置角色主键
|
|
||||||
* @return 菜单配置角色
|
|
||||||
*/
|
|
||||||
public WxMenuConfigRole selectWxMenuConfigRoleBySmcid(Long smcid);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询菜单配置角色列表
|
|
||||||
*
|
|
||||||
* @param wxMenuConfigRole 菜单配置角色
|
|
||||||
* @return 菜单配置角色集合
|
|
||||||
*/
|
|
||||||
public List<WxMenuConfigRole> selectWxMenuConfigRoleList(WxMenuConfigRole wxMenuConfigRole);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增菜单配置角色
|
|
||||||
*
|
|
||||||
* @param wxMenuConfigRole 菜单配置角色
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertWxMenuConfigRole(WxMenuConfigRole wxMenuConfigRole);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改菜单配置角色
|
|
||||||
*
|
|
||||||
* @param wxMenuConfigRole 菜单配置角色
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateWxMenuConfigRole(WxMenuConfigRole wxMenuConfigRole);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除菜单配置角色
|
|
||||||
*
|
|
||||||
* @param smcids 需要删除的菜单配置角色主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteWxMenuConfigRoleBySmcids(Long[] smcids);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除菜单配置角色信息
|
|
||||||
*
|
|
||||||
* @param smcid 菜单配置角色主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteWxMenuConfigRoleBySmcid(Long smcid);
|
|
||||||
}
|
|
|
@ -1,69 +0,0 @@
|
||||||
package com.yanzhu.manage.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.yanzhu.manage.domain.WxMenuConfig;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单配置Service接口
|
|
||||||
*
|
|
||||||
* @author JiangYuQi
|
|
||||||
* @date 2024-12-29
|
|
||||||
*/
|
|
||||||
public interface IWxMenuConfigService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询菜单配置
|
|
||||||
*
|
|
||||||
* @param id 菜单配置主键
|
|
||||||
* @return 菜单配置
|
|
||||||
*/
|
|
||||||
public WxMenuConfig selectWxMenuConfigById(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询菜单配置列表
|
|
||||||
*
|
|
||||||
* @param wxMenuConfig 菜单配置
|
|
||||||
* @return 菜单配置集合
|
|
||||||
*/
|
|
||||||
public List<WxMenuConfig> selectWxMenuConfigList(WxMenuConfig wxMenuConfig);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增菜单配置
|
|
||||||
*
|
|
||||||
* @param wxMenuConfig 菜单配置
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertWxMenuConfig(WxMenuConfig wxMenuConfig);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改菜单配置
|
|
||||||
*
|
|
||||||
* @param wxMenuConfig 菜单配置
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateWxMenuConfig(WxMenuConfig wxMenuConfig);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除菜单配置
|
|
||||||
*
|
|
||||||
* @param ids 需要删除的菜单配置主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteWxMenuConfigByIds(Long[] ids);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除菜单配置信息
|
|
||||||
*
|
|
||||||
* @param id 菜单配置主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteWxMenuConfigById(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询微信用户菜单
|
|
||||||
*
|
|
||||||
* @param wxMenuConfig 菜单配置
|
|
||||||
* @return 菜单配置集合
|
|
||||||
*/
|
|
||||||
public List<WxMenuConfig> findUserMenuList(WxMenuConfig wxMenuConfig);
|
|
||||||
}
|
|
|
@ -1,93 +0,0 @@
|
||||||
package com.yanzhu.manage.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.yanzhu.manage.mapper.WxMenuConfigRoleMapper;
|
|
||||||
import com.yanzhu.manage.domain.WxMenuConfigRole;
|
|
||||||
import com.yanzhu.manage.service.IWxMenuConfigRoleService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单配置角色Service业务层处理
|
|
||||||
*
|
|
||||||
* @author JiangYuQi
|
|
||||||
* @date 2024-12-29
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class WxMenuConfigRoleServiceImpl implements IWxMenuConfigRoleService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private WxMenuConfigRoleMapper wxMenuConfigRoleMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询菜单配置角色
|
|
||||||
*
|
|
||||||
* @param smcid 菜单配置角色主键
|
|
||||||
* @return 菜单配置角色
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public WxMenuConfigRole selectWxMenuConfigRoleBySmcid(Long smcid)
|
|
||||||
{
|
|
||||||
return wxMenuConfigRoleMapper.selectWxMenuConfigRoleBySmcid(smcid);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询菜单配置角色列表
|
|
||||||
*
|
|
||||||
* @param wxMenuConfigRole 菜单配置角色
|
|
||||||
* @return 菜单配置角色
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<WxMenuConfigRole> selectWxMenuConfigRoleList(WxMenuConfigRole wxMenuConfigRole)
|
|
||||||
{
|
|
||||||
return wxMenuConfigRoleMapper.selectWxMenuConfigRoleList(wxMenuConfigRole);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增菜单配置角色
|
|
||||||
*
|
|
||||||
* @param wxMenuConfigRole 菜单配置角色
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertWxMenuConfigRole(WxMenuConfigRole wxMenuConfigRole)
|
|
||||||
{
|
|
||||||
return wxMenuConfigRoleMapper.insertWxMenuConfigRole(wxMenuConfigRole);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改菜单配置角色
|
|
||||||
*
|
|
||||||
* @param wxMenuConfigRole 菜单配置角色
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateWxMenuConfigRole(WxMenuConfigRole wxMenuConfigRole)
|
|
||||||
{
|
|
||||||
return wxMenuConfigRoleMapper.updateWxMenuConfigRole(wxMenuConfigRole);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除菜单配置角色
|
|
||||||
*
|
|
||||||
* @param smcids 需要删除的菜单配置角色主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteWxMenuConfigRoleBySmcids(Long[] smcids)
|
|
||||||
{
|
|
||||||
return wxMenuConfigRoleMapper.deleteWxMenuConfigRoleBySmcids(smcids);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除菜单配置角色信息
|
|
||||||
*
|
|
||||||
* @param smcid 菜单配置角色主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteWxMenuConfigRoleBySmcid(Long smcid)
|
|
||||||
{
|
|
||||||
return wxMenuConfigRoleMapper.deleteWxMenuConfigRoleBySmcid(smcid);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,22 +1,26 @@
|
||||||
package com.yanzhu.manage.service.impl;
|
package com.yanzhu.manage.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.yanzhu.common.core.utils.DateUtils;
|
import com.yanzhu.common.core.utils.DateUtils;
|
||||||
|
import com.yanzhu.common.core.utils.StringUtils;
|
||||||
|
import com.yanzhu.manage.domain.WxMenuConfig;
|
||||||
|
import com.yanzhu.manage.domain.WxMenuConfigRole;
|
||||||
|
import com.yanzhu.manage.mapper.WxMenuConfigMapper;
|
||||||
|
import com.yanzhu.manage.service.IWxMenuConfigService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.yanzhu.manage.mapper.WxMenuConfigMapper;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import com.yanzhu.manage.domain.WxMenuConfig;
|
|
||||||
import com.yanzhu.manage.service.IWxMenuConfigService;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单配置Service业务层处理
|
* 菜单配置Service业务层处理
|
||||||
*
|
*
|
||||||
* @author JiangYuQi
|
* @author JiangYuQi
|
||||||
* @date 2024-12-29
|
* @date 2025-03-09
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class WxMenuConfigServiceImpl implements IWxMenuConfigService
|
public class WxMenuConfigServiceImpl implements IWxMenuConfigService
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private WxMenuConfigMapper wxMenuConfigMapper;
|
private WxMenuConfigMapper wxMenuConfigMapper;
|
||||||
|
@ -51,11 +55,14 @@ public class WxMenuConfigServiceImpl implements IWxMenuConfigService
|
||||||
* @param wxMenuConfig 菜单配置
|
* @param wxMenuConfig 菜单配置
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public int insertWxMenuConfig(WxMenuConfig wxMenuConfig)
|
public int insertWxMenuConfig(WxMenuConfig wxMenuConfig)
|
||||||
{
|
{
|
||||||
wxMenuConfig.setCreateTime(DateUtils.getNowDate());
|
wxMenuConfig.setCreateTime(DateUtils.getNowDate());
|
||||||
return wxMenuConfigMapper.insertWxMenuConfig(wxMenuConfig);
|
int rows = wxMenuConfigMapper.insertWxMenuConfig(wxMenuConfig);
|
||||||
|
insertWxMenuConfigRole(wxMenuConfig);
|
||||||
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -64,9 +71,12 @@ public class WxMenuConfigServiceImpl implements IWxMenuConfigService
|
||||||
* @param wxMenuConfig 菜单配置
|
* @param wxMenuConfig 菜单配置
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public int updateWxMenuConfig(WxMenuConfig wxMenuConfig)
|
public int updateWxMenuConfig(WxMenuConfig wxMenuConfig)
|
||||||
{
|
{
|
||||||
|
wxMenuConfigMapper.deleteWxMenuConfigRoleBySmcid(wxMenuConfig.getId());
|
||||||
|
insertWxMenuConfigRole(wxMenuConfig);
|
||||||
return wxMenuConfigMapper.updateWxMenuConfig(wxMenuConfig);
|
return wxMenuConfigMapper.updateWxMenuConfig(wxMenuConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,9 +86,11 @@ public class WxMenuConfigServiceImpl implements IWxMenuConfigService
|
||||||
* @param ids 需要删除的菜单配置主键
|
* @param ids 需要删除的菜单配置主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public int deleteWxMenuConfigByIds(Long[] ids)
|
public int deleteWxMenuConfigByIds(Long[] ids)
|
||||||
{
|
{
|
||||||
|
wxMenuConfigMapper.deleteWxMenuConfigRoleBySmcids(ids);
|
||||||
return wxMenuConfigMapper.deleteWxMenuConfigByIds(ids);
|
return wxMenuConfigMapper.deleteWxMenuConfigByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,12 +100,38 @@ public class WxMenuConfigServiceImpl implements IWxMenuConfigService
|
||||||
* @param id 菜单配置主键
|
* @param id 菜单配置主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public int deleteWxMenuConfigById(Long id)
|
public int deleteWxMenuConfigById(Long id)
|
||||||
{
|
{
|
||||||
|
wxMenuConfigMapper.deleteWxMenuConfigRoleBySmcid(id);
|
||||||
return wxMenuConfigMapper.deleteWxMenuConfigById(id);
|
return wxMenuConfigMapper.deleteWxMenuConfigById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增菜单配置角色信息
|
||||||
|
*
|
||||||
|
* @param wxMenuConfig 菜单配置对象
|
||||||
|
*/
|
||||||
|
public void insertWxMenuConfigRole(WxMenuConfig wxMenuConfig)
|
||||||
|
{
|
||||||
|
List<WxMenuConfigRole> wxMenuConfigRoleList = wxMenuConfig.getWxMenuConfigRoleList();
|
||||||
|
Long id = wxMenuConfig.getId();
|
||||||
|
if (StringUtils.isNotNull(wxMenuConfigRoleList))
|
||||||
|
{
|
||||||
|
List<WxMenuConfigRole> list = new ArrayList<WxMenuConfigRole>();
|
||||||
|
for (WxMenuConfigRole wxMenuConfigRole : wxMenuConfigRoleList)
|
||||||
|
{
|
||||||
|
wxMenuConfigRole.setSmcid(id);
|
||||||
|
list.add(wxMenuConfigRole);
|
||||||
|
}
|
||||||
|
if (list.size() > 0)
|
||||||
|
{
|
||||||
|
wxMenuConfigMapper.batchWxMenuConfigRole(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询微信用户菜单
|
* 查询微信用户菜单
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue