diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/sys/dao/SysRoleDataScopeMapper.java b/tamguo-oms/src/main/java/com/tamguo/modules/sys/dao/SysRoleDataScopeMapper.java new file mode 100644 index 0000000..bbf8b5e --- /dev/null +++ b/tamguo-oms/src/main/java/com/tamguo/modules/sys/dao/SysRoleDataScopeMapper.java @@ -0,0 +1,8 @@ +package com.tamguo.modules.sys.dao; + +import com.tamguo.config.dao.SuperMapper; +import com.tamguo.modules.sys.model.SysRoleDataScopeEntity; + +public interface SysRoleDataScopeMapper extends SuperMapper{ + +} diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/sys/model/SysRoleDataScopeEntity.java b/tamguo-oms/src/main/java/com/tamguo/modules/sys/model/SysRoleDataScopeEntity.java new file mode 100644 index 0000000..56219d2 --- /dev/null +++ b/tamguo-oms/src/main/java/com/tamguo/modules/sys/model/SysRoleDataScopeEntity.java @@ -0,0 +1,38 @@ +package com.tamguo.modules.sys.model; + +import com.baomidou.mybatisplus.annotations.TableName; + +@TableName(value="sys_role_data_scope") +public class SysRoleDataScopeEntity { + + private String roleCode; + private String ctrlType; + private String ctrlData; + private String ctrlPermi; + + public String getRoleCode() { + return roleCode; + } + public void setRoleCode(String roleCode) { + this.roleCode = roleCode; + } + public String getCtrlType() { + return ctrlType; + } + public void setCtrlType(String ctrlType) { + this.ctrlType = ctrlType; + } + public String getCtrlData() { + return ctrlData; + } + public void setCtrlData(String ctrlData) { + this.ctrlData = ctrlData; + } + public String getCtrlPermi() { + return ctrlPermi; + } + public void setCtrlPermi(String ctrlPermi) { + this.ctrlPermi = ctrlPermi; + } + +} diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/ISysRoleDataScopeService.java b/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/ISysRoleDataScopeService.java new file mode 100644 index 0000000..0ee8d4a --- /dev/null +++ b/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/ISysRoleDataScopeService.java @@ -0,0 +1,8 @@ +package com.tamguo.modules.sys.service; + +import com.baomidou.mybatisplus.service.IService; +import com.tamguo.modules.sys.model.SysRoleDataScopeEntity; + +public interface ISysRoleDataScopeService extends IService{ + +} diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysRoleDataScopeServiceImpl.java b/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysRoleDataScopeServiceImpl.java new file mode 100644 index 0000000..55cdf35 --- /dev/null +++ b/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysRoleDataScopeServiceImpl.java @@ -0,0 +1,14 @@ +package com.tamguo.modules.sys.service.impl; + +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.service.impl.ServiceImpl; +import com.tamguo.modules.sys.dao.SysRoleDataScopeMapper; +import com.tamguo.modules.sys.model.SysRoleDataScopeEntity; +import com.tamguo.modules.sys.service.ISysRoleDataScopeService; + +@Service +public class SysRoleDataScopeServiceImpl extends ServiceImpl implements ISysRoleDataScopeService{ + + +} diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/sys/web/SysRoleController.java b/tamguo-oms/src/main/java/com/tamguo/modules/sys/web/SysRoleController.java index cd31edf..3b7b676 100644 --- a/tamguo-oms/src/main/java/com/tamguo/modules/sys/web/SysRoleController.java +++ b/tamguo-oms/src/main/java/com/tamguo/modules/sys/web/SysRoleController.java @@ -1,7 +1,6 @@ package com.tamguo.modules.sys.web; import java.util.Map; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -9,9 +8,11 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; +import com.baomidou.mybatisplus.mapper.Condition; import com.baomidou.mybatisplus.plugins.Page; import com.tamguo.modules.sys.model.SysRoleEntity; import com.tamguo.modules.sys.model.condition.SysRoleCondition; +import com.tamguo.modules.sys.service.ISysRoleDataScopeService; import com.tamguo.modules.sys.service.ISysRoleService; import com.tamguo.modules.sys.utils.Result; @@ -28,6 +29,8 @@ public class SysRoleController { @Autowired private ISysRoleService iSysRoleService; + @Autowired + private ISysRoleDataScopeService iSysRoleDataScopeService; /** 角色首页*/ @RequestMapping(path="index") @@ -44,9 +47,11 @@ public class SysRoleController { } /** 数据权限 */ + @SuppressWarnings("unchecked") @RequestMapping(path="dataScope") public ModelAndView dataScope(String roleCode , ModelAndView model) { model.addObject("role", iSysRoleService.selectById(roleCode)); + model.addObject("roleDataScopeList" , iSysRoleDataScopeService.selectList(Condition.create().eq("role_code", roleCode))); model.setViewName(ROLE_DATA_INDEX_PAGE); return model; } diff --git a/tamguo-oms/src/main/resources/mappers/SysRoleDataScopeMapper.xml b/tamguo-oms/src/main/resources/mappers/SysRoleDataScopeMapper.xml new file mode 100644 index 0000000..53fd078 --- /dev/null +++ b/tamguo-oms/src/main/resources/mappers/SysRoleDataScopeMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tamguo-oms/src/main/resources/templates/modules/sys/role/dataScope.html b/tamguo-oms/src/main/resources/templates/modules/sys/role/dataScope.html index 1cb1c0a..2ab17e9 100644 --- a/tamguo-oms/src/main/resources/templates/modules/sys/role/dataScope.html +++ b/tamguo-oms/src/main/resources/templates/modules/sys/role/dataScope.html @@ -258,8 +258,10 @@ for (var i=0; i \ No newline at end of file