多公司模式合并提交
This commit is contained in:
parent
2b117c00a4
commit
bf7eade9ff
|
|
@ -0,0 +1,69 @@
|
|||
package com.bonus.system.api.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 sys_address
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class SysAddress extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 自增编号 */
|
||||
private Long id;
|
||||
|
||||
/** 平台ID */
|
||||
@Excel(name = "平台ID")
|
||||
@ApiModelProperty(value = "平台ID")
|
||||
private Long platformId;
|
||||
|
||||
/** 县镇市省编码,省、直辖市两位;普通市、直辖(区、县)两位;普通县两位;镇、乡3位;村委会3位;共12位 */
|
||||
@Excel(name = "县镇市省编码,省、直辖市两位;普通市、直辖", readConverterExp = "区=、县")
|
||||
private String code;
|
||||
|
||||
/** 父级code */
|
||||
@Excel(name = "父级code")
|
||||
@ApiModelProperty(value = "父级code")
|
||||
private String parentCode;
|
||||
|
||||
/** 地区名称 */
|
||||
@Excel(name = "地区名称")
|
||||
@ApiModelProperty(value = "地区名称")
|
||||
private String name;
|
||||
|
||||
/** 纬度 */
|
||||
@Excel(name = "纬度")
|
||||
@ApiModelProperty(value = "纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
/** 经度 */
|
||||
@Excel(name = "经度")
|
||||
@ApiModelProperty(value = "经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
/** 等级:1省 2市 3县/县级市/区 4镇/街道 5村/社区 */
|
||||
@Excel(name = "等级:1省 2市 3县/县级市/区 4镇/街道 5村/社区")
|
||||
@ApiModelProperty(value = "等级:1省 2市 3县/县级市/区 4镇/街道 5村/社区")
|
||||
private Integer level;
|
||||
|
||||
/** 区域划分 1:华北 2:华东 3:华中 4:华南 5:东北 6:西北 7:西南 8:港澳台 9:海外 */
|
||||
@Excel(name = "区域划分 1:华北 2:华东 3:华中 4:华南 5:东北 6:西北 7:西南 8:港澳台 9:海外")
|
||||
@ApiModelProperty(value = "区域划分 1:华北 2:华东 3:华中 4:华南 5:东北 6:西北 7:西南 8:港澳台 9:海外")
|
||||
private Integer region;
|
||||
|
||||
/** 状态:0启用 2已作废 */
|
||||
private String delFlag;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -73,14 +73,20 @@ public class SysDept extends BaseEntity {
|
|||
* 父部门名称
|
||||
*/
|
||||
private String parentName;
|
||||
|
||||
//权限模版ID
|
||||
private Long menuTemplateId;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 县
|
||||
*/
|
||||
|
|
@ -91,6 +97,52 @@ public class SysDept extends BaseEntity {
|
|||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 公司简称
|
||||
*/
|
||||
private String deptAbbreviation;
|
||||
|
||||
/**
|
||||
* 公司概述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* logo
|
||||
*/
|
||||
private String logo;
|
||||
|
||||
//公司管理员用户ID
|
||||
private Long adminUserId;
|
||||
|
||||
/**
|
||||
* 公司用户初始密码
|
||||
*/
|
||||
private String initPassword;
|
||||
|
||||
private SysUser sysUser;
|
||||
|
||||
/**
|
||||
* 所属公司ID
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
private Long userCount;
|
||||
|
||||
/**
|
||||
*角色名称
|
||||
*/
|
||||
private String roleName;
|
||||
|
||||
private String keyWord;
|
||||
|
||||
public Long getMenuTemplateId() {
|
||||
return menuTemplateId;
|
||||
}
|
||||
|
||||
public void setMenuTemplateId(Long menuTemplateId) {
|
||||
this.menuTemplateId = menuTemplateId;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
|
|
@ -117,8 +169,6 @@ public class SysDept extends BaseEntity {
|
|||
return city;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
|
@ -127,6 +177,87 @@ public class SysDept extends BaseEntity {
|
|||
this.province = province;
|
||||
}
|
||||
|
||||
public String getDeptAbbreviation() {
|
||||
return deptAbbreviation;
|
||||
}
|
||||
|
||||
public void setDeptAbbreviation(String deptAbbreviation) {
|
||||
this.deptAbbreviation = deptAbbreviation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getLogo() {
|
||||
return logo;
|
||||
}
|
||||
|
||||
public void setLogo(String logo) {
|
||||
this.logo = logo;
|
||||
}
|
||||
|
||||
public Long getAdminUserId() {
|
||||
return adminUserId;
|
||||
}
|
||||
|
||||
public void setAdminUserId(Long adminUserId) {
|
||||
this.adminUserId = adminUserId;
|
||||
}
|
||||
|
||||
public String getInitPassword() {
|
||||
return initPassword;
|
||||
}
|
||||
|
||||
public void setInitPassword(String initPassword) {
|
||||
this.initPassword = initPassword;
|
||||
}
|
||||
|
||||
public SysUser getSysUser() {
|
||||
return sysUser;
|
||||
}
|
||||
|
||||
public void setSysUser(SysUser sysUser) {
|
||||
this.sysUser = sysUser;
|
||||
}
|
||||
|
||||
public Long getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(Long companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public Long getUserCount() {
|
||||
return userCount;
|
||||
}
|
||||
|
||||
public void setUserCount(Long userCount) {
|
||||
this.userCount = userCount;
|
||||
}
|
||||
|
||||
public String getRoleName() {
|
||||
return roleName;
|
||||
}
|
||||
|
||||
public void setRoleName(String roleName) {
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
||||
public String getKeyWord() {
|
||||
return keyWord;
|
||||
}
|
||||
|
||||
public void setKeyWord(String keyWord) {
|
||||
this.keyWord = keyWord;
|
||||
}
|
||||
|
||||
/**
|
||||
* 子部门
|
||||
|
|
|
|||
|
|
@ -72,6 +72,8 @@ public class SysMenu extends BaseEntity
|
|||
/** 系统类型 */
|
||||
private String systemType;
|
||||
|
||||
private Long templateId;
|
||||
|
||||
public Long getMenuId()
|
||||
{
|
||||
return menuId;
|
||||
|
|
@ -247,6 +249,14 @@ public class SysMenu extends BaseEntity
|
|||
this.systemType = systemType;
|
||||
}
|
||||
|
||||
public Long getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
|
||||
public void setTemplateId(Long templateId) {
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ public class SysPost extends BaseEntity
|
|||
@Excel(name = "岗位名称")
|
||||
private String postName;
|
||||
|
||||
/** 所属公司ID */
|
||||
private Long companyId;
|
||||
|
||||
/** 岗位排序 */
|
||||
@Excel(name = "岗位排序")
|
||||
private Integer postSort;
|
||||
|
|
@ -80,6 +83,14 @@ public class SysPost extends BaseEntity
|
|||
this.postName = postName;
|
||||
}
|
||||
|
||||
public Long getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(Long companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
public Integer getPostSort()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -65,6 +65,11 @@ public class SysRole extends BaseEntity
|
|||
/** 部门组(数据权限) */
|
||||
private Long[] deptIds;
|
||||
|
||||
/**
|
||||
* 所属公司ID
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/** 角色菜单权限 */
|
||||
private Set<String> permissions;
|
||||
|
||||
|
|
@ -216,6 +221,14 @@ public class SysRole extends BaseEntity
|
|||
this.deptIds = deptIds;
|
||||
}
|
||||
|
||||
public Long getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(Long companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public Set<String> getPermissions()
|
||||
{
|
||||
return permissions;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
package com.bonus.system.api.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限模板对象 sys_template
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2020-07-09
|
||||
*/
|
||||
@Data
|
||||
public class SysTemplate extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 模板名称 */
|
||||
@Excel(name = "模板名称")
|
||||
private String name;
|
||||
|
||||
private List<Long> menuIds;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.bonus.system.api.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 系统模板菜单表(SysTempMenu)实体类
|
||||
*
|
||||
* @author bonus
|
||||
* @since 2020-07-09 13:38:36
|
||||
*/
|
||||
public class SysTemplateMenu implements Serializable {
|
||||
private static final long serialVersionUID = 904598953972609708L;
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
private Long tempId;
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
private Long menuId;
|
||||
|
||||
|
||||
public Long getTempId() {
|
||||
return tempId;
|
||||
}
|
||||
|
||||
public void setTempId(Long tempId) {
|
||||
this.tempId = tempId;
|
||||
}
|
||||
|
||||
public Long getMenuId() {
|
||||
return menuId;
|
||||
}
|
||||
|
||||
public void setMenuId(Long menuId) {
|
||||
this.menuId = menuId;
|
||||
}
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ public class MimeTypeUtils
|
|||
|
||||
public static final String[] DEFAULT_ALLOWED_EXTENSION = {
|
||||
// 图片
|
||||
"bmp", "gif", "jpg", "jpeg", "png",
|
||||
"bmp", "gif", "jpg", "jpeg", "png", "svg",
|
||||
// word excel powerpoint
|
||||
"doc", "docx", "xls", "xlsx","csv", "ppt", "pptx", "html", "htm", "txt",
|
||||
// 压缩文件
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ public class AuthLogic
|
|||
/** 管理员角色权限标识 */
|
||||
private static final String SUPER_ADMIN = "admin";
|
||||
|
||||
/** 管理员角色权限标识 */
|
||||
private static final String COMPANY_ADMIN = "company_admin";
|
||||
|
||||
public TokenService tokenService = SpringUtils.getBean(TokenService.class);
|
||||
|
||||
|
||||
|
|
@ -429,6 +432,6 @@ public class AuthLogic
|
|||
public boolean hasRole(Collection<String> roles, String role)
|
||||
{
|
||||
return roles.stream().filter(StringUtils::hasText)
|
||||
.anyMatch(x -> SUPER_ADMIN.equals(x) || PatternMatchUtils.simpleMatch(x, role));
|
||||
.anyMatch(x -> SUPER_ADMIN.equals(x) || COMPANY_ADMIN.equals(x) || PatternMatchUtils.simpleMatch(x, role));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE;
|
|||
public class ParamSecureHandler implements AsyncHandlerInterceptor {
|
||||
|
||||
private static final String [] WHITE_URL = {
|
||||
"/login", "/isAdmin", "/isLogin" ,"/register","/user/register","/operlog/addLogs","/job/edit","/user","/user/resetPwd","/user/profile/updatePwd","/user/confirmPassword"};
|
||||
"/login", "/isAdmin", "/isLogin" ,"/register","/user/register","/operlog/addLogs","/job/edit",
|
||||
"/user","/user/resetPwd","/user/profile/updatePwd","/user/confirmPassword","/dept","/dept/edit"};
|
||||
private String rnd = null;
|
||||
|
||||
public static String ur = "/";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
package com.bonus.system.controller;
|
||||
|
||||
import com.bonus.system.api.domain.SysAddress;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.bonus.system.service.ISysAddressService;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 地址管理Controller
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
@Api(tags = "地址管理接口")
|
||||
@RestController
|
||||
@RequestMapping("/address")
|
||||
public class SysAddressController extends BaseController {
|
||||
@Autowired
|
||||
private ISysAddressService sysAddressService;
|
||||
|
||||
/**
|
||||
* 查询地址列表
|
||||
*/
|
||||
@ApiOperation(value = "查询地址列表")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysAddress sysAddress) {
|
||||
List<SysAddress> list = sysAddressService.selectSysAddressList(sysAddress);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取地址详细信息
|
||||
*/
|
||||
@ApiOperation(value = "获取地址详细信息")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(sysAddressService.selectSysAddressById(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +1,10 @@
|
|||
package com.bonus.system.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
|
|
@ -11,11 +14,9 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
|
@ -104,15 +105,15 @@ public class SysDeptController extends BaseController
|
|||
return toAjax(deptService.insertDept(dept));
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return error("系统异常, " + e.getMessage());
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:dept:edit"))
|
||||
@PostMapping("/edit")
|
||||
@PostMapping("/edit")
|
||||
@SysLog(title = "部门管理", businessType = OperaType.UPDATE,logType = 0,module = "系统管理->部门管理")
|
||||
public AjaxResult edit(@Validated @RequestBody SysDept dept) {
|
||||
try{
|
||||
|
|
@ -129,8 +130,8 @@ public class SysDeptController extends BaseController
|
|||
return toAjax(deptService.updateDept(dept));
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return error("系统异常, " + e.getMessage());
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -155,4 +156,62 @@ public class SysDeptController extends BaseController
|
|||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据登录用户获取公司详细信息
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:dept:query"))
|
||||
@GetMapping(value = "/company_info")
|
||||
public AjaxResult getCompanyInfo() {
|
||||
try{
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
return success(deptService.selectDeptById(companyId));
|
||||
} catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:dept:query"))
|
||||
@GetMapping("/deptList")
|
||||
@SysLog(title = "获取公司列表", businessType = OperaType.QUERY,logType = 0,module = "系统管理->获取公司列表")
|
||||
public TableDataInfo deptList(SysDept dept) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权查看公司列表!");
|
||||
}
|
||||
List<SysDept> deptList1 = new ArrayList<>();
|
||||
try{
|
||||
startPage();
|
||||
dept.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
deptList1 = deptService.getDeptList(dept);
|
||||
List<SysDept> deptList2 = deptService.getCompanyUserCount();
|
||||
for (SysDept dept1 : deptList1) {
|
||||
for (SysDept dept2 : deptList2) {
|
||||
if (dept1.getDeptId().equals(dept2.getCompanyId())) {
|
||||
dept1.setUserCount(dept2.getUserCount());
|
||||
}
|
||||
}
|
||||
}
|
||||
return getDataTable(deptList1);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return getDataTableError(deptList1);
|
||||
}
|
||||
|
||||
@PostMapping("/turnOnOff")
|
||||
@SysLog(title = "注销或恢复公司", businessType = OperaType.UPDATE,logType = 0,module = "系统管理->注销或恢复公司")
|
||||
public AjaxResult turnOnOff(@Validated @RequestBody SysDept dept) {
|
||||
try{
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权注销或恢复公司!");
|
||||
}
|
||||
log.info("公司信息{}",dept.getDeptId());
|
||||
return toAjax(deptService.turnOnOffDeptById(dept));
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,10 @@ import com.bonus.common.log.annotation.SysLog;
|
|||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
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.domain.UserMenuParams;
|
||||
import com.bonus.system.service.ISysDeptService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
|
@ -40,6 +42,9 @@ public class SysMenuController extends BaseController
|
|||
@Autowired
|
||||
private ISysMenuService menuService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
/**
|
||||
* 获取当前用户的菜单列表
|
||||
*/
|
||||
|
|
@ -199,7 +204,8 @@ public class SysMenuController extends BaseController
|
|||
try{
|
||||
|
||||
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.getMenuTemplateId());
|
||||
List<SysMenu> menus = menuService.selectMenuTreeByUserIdAndSystemType(userMenuParams);
|
||||
return success(menuService.buildMenus(menus));
|
||||
}catch (Exception e){
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.bonus.common.log.annotation.SysLog;
|
|||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import com.bonus.config.SystemConfig;
|
||||
import com.bonus.system.api.domain.SysPost;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -40,6 +41,9 @@ public class SysPostController extends BaseController {
|
|||
@Autowired
|
||||
private ISysPostService postService;
|
||||
|
||||
@Autowired
|
||||
SystemConfig systemConfig;
|
||||
|
||||
/**
|
||||
* 获取岗位列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,148 @@
|
|||
package com.bonus.system.controller;
|
||||
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.SysMenu;
|
||||
import com.bonus.system.api.domain.SysTemplate;
|
||||
import com.bonus.system.api.domain.SysTemplateMenu;
|
||||
import com.bonus.system.service.ISysMenuService;
|
||||
import com.bonus.system.service.ISysTemplateMenuService;
|
||||
import com.bonus.system.service.ISysTemplateService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限模板Controller
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2025-01-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/template")
|
||||
@Slf4j
|
||||
public class SysTemplateController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISysTemplateService sysTemplateService;
|
||||
|
||||
@Autowired
|
||||
private ISysTemplateMenuService sysTemplateMenuService;
|
||||
|
||||
@Autowired
|
||||
private ISysMenuService menuService;
|
||||
|
||||
/**
|
||||
* 查询权限模板列表
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:list"))
|
||||
@SysLog(title = "权限模板管理", businessType = OperaType.EXPORT,logType = 0,module = "公司管理->权限模板管理")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysTemplate sysTemplate) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权查看公司权限列表!");
|
||||
}
|
||||
startPage();
|
||||
List<SysTemplate> list = sysTemplateService.selectSysTemplateList(sysTemplate);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载对应角色菜单列表树
|
||||
*/
|
||||
@GetMapping(value = "/templateMenuTreeselect/{tempId}")
|
||||
public AjaxResult templateMenuTreeselect(@PathVariable("tempId") Long tempId) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权查看公司权限菜单列表!");
|
||||
}
|
||||
try{
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> menus = menuService.selectMenuList(userId);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("checkedKeys", sysTemplateMenuService.queryMenuIdByTemplateId(tempId));
|
||||
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
|
||||
return ajax;
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出权限模板列表
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:list"))
|
||||
@SysLog(title = "权限模板管理", businessType = OperaType.EXPORT,logType = 0,module = "公司管理->权限模板管理")
|
||||
@GetMapping("/export")
|
||||
public void export(HttpServletResponse response, SysTemplate sysTemplate) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权查看公司权限列表!");
|
||||
}
|
||||
List<SysTemplate> list = sysTemplateService.selectSysTemplateList(sysTemplate);
|
||||
ExcelUtil<SysTemplate> util = new ExcelUtil<SysTemplate>(SysTemplate.class);
|
||||
util.exportExcel(response, list, "template");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取权限模板详细信息
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:list"))
|
||||
@SysLog(title = "权限模板管理", businessType = OperaType.EXPORT,logType = 0,module = "公司管理->权限模板管理")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权查看公司权限列表!");
|
||||
}
|
||||
return AjaxResult.success(sysTemplateService.selectSysTemplateById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增权限模板
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:add"))
|
||||
@SysLog(title = "权限模板管理", businessType = OperaType.INSERT,logType = 0,module = "公司管理->权限模板管理")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysTemplate sysTemplate) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权添加公司权限列表!");
|
||||
}
|
||||
return toAjax(sysTemplateService.insertSysTemplate(sysTemplate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改权限模板
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:edit"))
|
||||
@SysLog(title = "权限模板管理", businessType = OperaType.UPDATE,logType = 0,module = "公司管理->权限模板管理")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody SysTemplate sysTemplate) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权更新公司权限列表!");
|
||||
}
|
||||
return toAjax(sysTemplateService.updateSysTemplate(sysTemplate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除权限模板
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:edit"))
|
||||
@SysLog(title = "权限模板管理", businessType = OperaType.DELETE,logType = 0,module = "公司管理->权限模板管理")
|
||||
@PostMapping("/delete/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权删除公司权限列表!");
|
||||
}
|
||||
return toAjax(sysTemplateService.deleteSysTemplateByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.bonus.system.controller;
|
||||
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import com.bonus.system.api.domain.SysTemplateMenu;
|
||||
import com.bonus.system.service.ISysTemplateMenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限模板菜单Controller
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2025-01-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/template_menu")
|
||||
public class SysTemplateMenuController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISysTemplateMenuService sysTemplateMenuService;
|
||||
|
||||
/**
|
||||
* 查询权限模板菜单
|
||||
*/
|
||||
// @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:list"))
|
||||
// @SysLog(title = "权限模板菜单管理", businessType = OperaType.QUERY,logType = 0,module = "公司管理->权限模板菜单管理")
|
||||
// @GetMapping("/list")
|
||||
// public TableDataInfo list() {
|
||||
// //startPage();
|
||||
// List<SysTemplateMenu> list = sysTemplateMenuService.queryAll();
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 新增权限模板菜单
|
||||
*/
|
||||
// @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:add"))
|
||||
// @SysLog(title = "权限模板菜单管理", businessType = OperaType.INSERT,logType = 0,module = "公司管理->权限模板菜单管理")
|
||||
// @PostMapping
|
||||
// public AjaxResult add(@RequestBody List<SysTemplateMenu> list) {
|
||||
// return toAjax(sysTemplateMenuService.batchInsert(list));
|
||||
// }
|
||||
}
|
||||
|
|
@ -140,6 +140,11 @@ public class SysUserController extends BaseController {
|
|||
if (StringUtils.isNull(sysUser)) {
|
||||
return R.fail("用户名或密码错误");
|
||||
}
|
||||
SysDept sysDept = deptService.selectActiveDeptById(sysUser.getCompanyId());
|
||||
if (StringUtils.isNull(sysDept)) {
|
||||
logger.error("用户所在公司停用或注销");
|
||||
return R.fail("用户所在公司停用或注销");
|
||||
}
|
||||
// 角色集合
|
||||
Set<String> roles = permissionService.getRolePermission(sysUser);
|
||||
// 权限集合
|
||||
|
|
@ -162,6 +167,11 @@ public class SysUserController extends BaseController {
|
|||
if (StringUtils.isNull(sysUser)) {
|
||||
return R.fail("用户名或密码错误");
|
||||
}
|
||||
SysDept sysDept = deptService.selectActiveDeptById(sysUser.getCompanyId());
|
||||
if (StringUtils.isNull(sysDept)) {
|
||||
logger.error("用户所在公司停用或注销");
|
||||
return R.fail("用户所在公司停用或注销");
|
||||
}
|
||||
// 角色集合
|
||||
Set<String> roles = permissionService.getRolePermission(sysUser);
|
||||
// 权限集合
|
||||
|
|
@ -183,6 +193,11 @@ public class SysUserController extends BaseController {
|
|||
if (StringUtils.isNull(sysUser)) {
|
||||
return R.fail("用户名或密码错误");
|
||||
}
|
||||
SysDept sysDept = deptService.selectActiveDeptById(sysUser.getCompanyId());
|
||||
if (StringUtils.isNull(sysDept)) {
|
||||
logger.error("用户所在公司停用或注销");
|
||||
return R.fail("用户所在公司停用或注销");
|
||||
}
|
||||
// 角色集合
|
||||
Set<String> roles = permissionService.getRolePermission(sysUser);
|
||||
// 权限集合
|
||||
|
|
|
|||
|
|
@ -1,22 +1,22 @@
|
|||
package com.bonus.system.domain;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangvivi
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@Data
|
||||
public class UserMenuParams {
|
||||
private Long userId;
|
||||
private Long systemType;
|
||||
private Long templateId;
|
||||
|
||||
UserMenuParams(){}
|
||||
|
||||
public UserMenuParams(Long userId, Long systemType){
|
||||
public UserMenuParams(Long userId, Long systemType, Long templateId){
|
||||
this.userId = userId;
|
||||
this.systemType = systemType;
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
package com.bonus.system.mapper;
|
||||
|
||||
import com.bonus.system.api.domain.SysAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 地址管理Mapper接口
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
public interface SysAddressMapper {
|
||||
|
||||
/**
|
||||
* 查询地址管理列表
|
||||
*
|
||||
* @param sysAddress 地址管理
|
||||
* @return 地址管理集合
|
||||
*/
|
||||
public List<SysAddress> selectSysAddressList(SysAddress sysAddress);
|
||||
|
||||
/**
|
||||
* 查询地址管理
|
||||
*
|
||||
* @param id 地址管理主键
|
||||
* @return 地址管理
|
||||
*/
|
||||
public SysAddress selectSysAddressById(Long id);
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bonus.system.api.domain.SysDept;
|
||||
|
||||
|
|
@ -19,6 +21,15 @@ public interface SysDeptMapper
|
|||
*/
|
||||
public List<SysDept> selectDeptList(SysDept dept);
|
||||
|
||||
List<SysDept> getDeptList(SysDept dept);
|
||||
|
||||
/**
|
||||
* 获取省市县区
|
||||
* @param areaVo
|
||||
* @return
|
||||
*/
|
||||
// List<AreaVo> getArea(AreaVo areaVo);
|
||||
|
||||
/**
|
||||
* 查询部门人员树列表
|
||||
*
|
||||
|
|
@ -44,6 +55,14 @@ public interface SysDeptMapper
|
|||
*/
|
||||
public SysDept selectDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 部门信息
|
||||
*/
|
||||
public SysDept selectActiveDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据ID查询所有子部门
|
||||
*
|
||||
|
|
@ -123,4 +142,22 @@ public interface SysDeptMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 注销或恢复公司
|
||||
*
|
||||
* @param dept 当前公司
|
||||
*/
|
||||
public int turnOnOffDeptById(SysDept dept);
|
||||
|
||||
public List<SysDept> getCompanyUserCount();
|
||||
|
||||
/**
|
||||
* 获取公司管理员详情
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
public SysUser selectCompanyAdminByDept(@Param("deptId") Long deptId);
|
||||
|
||||
public int getDeptCountByMenuTemplateId(@Param("tempId") Long tempId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,9 +63,10 @@ public interface SysMenuMapper
|
|||
* 根据用户ID查询菜单
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param templateId 权限模板ID
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId);
|
||||
public List<SysMenu> selectMenuTreeByUserId(@Param("userId") Long userId, @Param("templateId")Long templateId);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询菜单
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public interface SysPostMapper
|
|||
*
|
||||
* @return 岗位列表
|
||||
*/
|
||||
public List<SysPost> selectPostAll();
|
||||
public List<SysPost> selectPostAll(SysPost sysPost);
|
||||
|
||||
/**
|
||||
* 通过岗位ID查询岗位信息
|
||||
|
|
@ -85,16 +85,16 @@ public interface SysPostMapper
|
|||
/**
|
||||
* 校验岗位名称
|
||||
*
|
||||
* @param postName 岗位名称
|
||||
* @param post
|
||||
* @return 结果
|
||||
*/
|
||||
public SysPost checkPostNameUnique(String postName);
|
||||
public SysPost checkPostNameUnique(SysPost post);
|
||||
|
||||
/**
|
||||
* 校验岗位编码
|
||||
*
|
||||
* @param postCode 岗位编码
|
||||
* @param post
|
||||
* @return 结果
|
||||
*/
|
||||
public SysPost checkPostCodeUnique(String postCode);
|
||||
public SysPost checkPostCodeUnique(SysPost post);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,18 +60,18 @@ public interface SysRoleMapper
|
|||
/**
|
||||
* 校验角色名称是否唯一
|
||||
*
|
||||
* @param roleName 角色名称
|
||||
* @param role 角色名称
|
||||
* @return 角色信息
|
||||
*/
|
||||
public SysRole checkRoleNameUnique(String roleName);
|
||||
public SysRole checkRoleNameUnique(SysRole role);
|
||||
|
||||
/**
|
||||
* 校验角色权限是否唯一
|
||||
*
|
||||
* @param roleKey 角色权限
|
||||
* @param role 角色权限
|
||||
* @return 角色信息
|
||||
*/
|
||||
public SysRole checkRoleKeyUnique(String roleKey);
|
||||
public SysRole checkRoleKeyUnique(SysRole role);
|
||||
|
||||
/**
|
||||
* 修改角色信息
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
package com.bonus.system.mapper;
|
||||
|
||||
import com.bonus.system.api.domain.SysTemplate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限模板Mapper接口
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2025-01-05
|
||||
*/
|
||||
public interface SysTemplateMapper
|
||||
{
|
||||
/**
|
||||
* 查询权限模板
|
||||
*
|
||||
* @param id 权限模板ID
|
||||
* @return 权限模板
|
||||
*/
|
||||
public SysTemplate selectSysTemplateById(Long id);
|
||||
|
||||
/**
|
||||
* 查询权限模板列表
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 权限模板集合
|
||||
*/
|
||||
public List<SysTemplate> selectSysTemplateList(SysTemplate sysTemplate);
|
||||
|
||||
/**
|
||||
* 新增权限模板
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysTemplate(SysTemplate sysTemplate);
|
||||
|
||||
/**
|
||||
* 修改权限模板
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysTemplate(SysTemplate sysTemplate);
|
||||
|
||||
/**
|
||||
* 删除权限模板
|
||||
*
|
||||
* @param id 权限模板ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysTemplateById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除权限模板
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysTemplateByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.bonus.system.mapper;
|
||||
|
||||
import com.bonus.system.api.domain.SysTemplateMenu;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统模板菜单表(SysTempMenu)表数据库访问层
|
||||
*
|
||||
* @author bonus
|
||||
* @since 2025-01-05
|
||||
*/
|
||||
public interface SysTemplateMenuMapper {
|
||||
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param
|
||||
* @param
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<SysTemplateMenu> queryAll();
|
||||
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*
|
||||
* @param tempId
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<Long> queryMenuIdByTemplateId(Long tempId);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param sysTemplateMenu 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(SysTemplateMenu sysTemplateMenu);
|
||||
|
||||
int batchInsert(@Param("list") List<SysTemplateMenu> list);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param sysTemplateMenu 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(SysTemplateMenu sysTemplateMenu);
|
||||
|
||||
/**
|
||||
* 根据模板删除菜单信息
|
||||
*
|
||||
* @param tempId
|
||||
* @return
|
||||
*/
|
||||
int deleteByTempId(@Param("tempId") Long tempId);
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.bonus.system.service;
|
||||
|
||||
import com.bonus.system.api.domain.SysAddress;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 地址管理Service接口
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
public interface ISysAddressService {
|
||||
|
||||
/**
|
||||
* 查询地址管理列表
|
||||
*
|
||||
* @param sysAddress 地址管理
|
||||
* @return 地址管理集合
|
||||
*/
|
||||
public List<SysAddress> selectSysAddressList(SysAddress sysAddress);
|
||||
|
||||
/**
|
||||
* 查询地址管理
|
||||
*
|
||||
* @param id 地址管理主键
|
||||
* @return 地址管理
|
||||
*/
|
||||
public SysAddress selectSysAddressById(Long id);
|
||||
|
||||
}
|
||||
|
|
@ -20,6 +20,10 @@ public interface ISysDeptService
|
|||
*/
|
||||
public List<SysDept> selectDeptList(SysDept dept);
|
||||
|
||||
public List<SysDept> getDeptList(SysDept dept);
|
||||
|
||||
public List<SysDept> getCompanyUserCount();
|
||||
|
||||
/**
|
||||
* 查询部门树结构信息
|
||||
*
|
||||
|
|
@ -68,6 +72,8 @@ public interface ISysDeptService
|
|||
*/
|
||||
public SysDept selectDeptById(Long deptId);
|
||||
|
||||
public SysDept selectActiveDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据ID查询所有子部门(正常状态)
|
||||
*
|
||||
|
|
@ -130,4 +136,11 @@ public interface ISysDeptService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 注销或恢复公司
|
||||
*
|
||||
* @param dept 当前公司
|
||||
*/
|
||||
public int turnOnOffDeptById(SysDept dept);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
package com.bonus.system.service;
|
||||
|
||||
import com.bonus.system.api.domain.SysTemplateMenu;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统模板菜单表(SysTemplateMenu)表服务接口
|
||||
*
|
||||
* @author bonus
|
||||
* @since 2025-01-05
|
||||
*/
|
||||
public interface ISysTemplateMenuService {
|
||||
|
||||
/**
|
||||
* 查询多条数据
|
||||
*
|
||||
* @param
|
||||
* @param
|
||||
* @return 对象列表
|
||||
*/
|
||||
public List<Long> queryMenuIdByTemplateId(Long tempId);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param sysTemplateMenu 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
SysTemplateMenu insert(SysTemplateMenu sysTemplateMenu);
|
||||
|
||||
public int batchInsert(List<SysTemplateMenu> list);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param sysTemplateMenu 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
SysTemplateMenu update(SysTemplateMenu sysTemplateMenu);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.bonus.system.service;
|
||||
|
||||
import com.bonus.system.api.domain.SysTemplate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限模板Service接口
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2025-01-05
|
||||
*/
|
||||
public interface ISysTemplateService
|
||||
{
|
||||
/**
|
||||
* 查询权限模板
|
||||
*
|
||||
* @param id 权限模板ID
|
||||
* @return 权限模板
|
||||
*/
|
||||
public SysTemplate selectSysTemplateById(Long id);
|
||||
|
||||
/**
|
||||
* 查询权限模板列表
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 权限模板集合
|
||||
*/
|
||||
public List<SysTemplate> selectSysTemplateList(SysTemplate sysTemplate);
|
||||
|
||||
/**
|
||||
* 新增权限模板
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysTemplate(SysTemplate sysTemplate);
|
||||
|
||||
/**
|
||||
* 修改权限模板
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysTemplate(SysTemplate sysTemplate);
|
||||
|
||||
public int deleteSysTemplateByIds(Long[] ids);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.bonus.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.bonus.system.api.domain.SysAddress;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.system.mapper.SysAddressMapper;
|
||||
import com.bonus.system.service.ISysAddressService;
|
||||
|
||||
/**
|
||||
* 地址管理Service业务层处理
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
@Service
|
||||
public class SysAddressServiceImpl implements ISysAddressService {
|
||||
@Autowired
|
||||
private SysAddressMapper sysAddressMapper;
|
||||
|
||||
/**
|
||||
* 查询地址管理列表
|
||||
*
|
||||
* @param sysAddress 地址管理
|
||||
* @return 地址管理
|
||||
*/
|
||||
@Override
|
||||
public List<SysAddress> selectSysAddressList(SysAddress sysAddress) {
|
||||
return sysAddressMapper.selectSysAddressList(sysAddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询地址管理
|
||||
*
|
||||
* @param id 地址管理主键
|
||||
* @return 地址管理
|
||||
*/
|
||||
@Override
|
||||
public SysAddress selectSysAddressById(Long id) {
|
||||
return sysAddressMapper.selectSysAddressById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +1,20 @@
|
|||
package com.bonus.system.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.bonus.system.mapper.SysUserMapper;
|
||||
import com.bonus.config.SystemConfig;
|
||||
import com.bonus.system.api.domain.*;
|
||||
import com.bonus.system.domain.SysRoleMenu;
|
||||
import com.bonus.system.mapper.*;
|
||||
import com.bonus.common.datascope.utils.CommonDataPermissionInfo;
|
||||
import com.bonus.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.common.core.constant.UserConstants;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
|
|
@ -19,13 +23,11 @@ import com.bonus.common.core.utils.SpringUtils;
|
|||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.datascope.annotation.DataScope;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.SysDept;
|
||||
import com.bonus.system.api.domain.SysRole;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.bonus.system.domain.vo.TreeSelect;
|
||||
import com.bonus.system.mapper.SysDeptMapper;
|
||||
import com.bonus.system.mapper.SysRoleMapper;
|
||||
import com.bonus.system.service.ISysDeptService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 部门管理 服务实现
|
||||
|
|
@ -33,6 +35,7 @@ import com.bonus.system.service.ISysDeptService;
|
|||
* @author bonus
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SysDeptServiceImpl implements ISysDeptService
|
||||
{
|
||||
@Autowired
|
||||
|
|
@ -44,6 +47,25 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
|
||||
@Resource
|
||||
private SysUserRoleMapper userRoleMapper;
|
||||
|
||||
@Resource
|
||||
private SysRoleMenuMapper roleMenuMapper;
|
||||
|
||||
@Resource
|
||||
SysTemplateMenuMapper sysTemplateMenuMapper;
|
||||
|
||||
@Resource
|
||||
private SysRoleDeptMapper roleDeptMapper;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
ISysUserService userService;
|
||||
|
||||
@Resource
|
||||
private SystemConfig systemConfig;
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
|
|
@ -64,9 +86,20 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
String str = dept.getDeptName().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
||||
dept.setDeptName(str);
|
||||
}
|
||||
dept.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
return deptMapper.selectDeptList(dept);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDept> getDeptList(SysDept dept) {
|
||||
return deptMapper.getDeptList(dept);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDept> getCompanyUserCount() {
|
||||
return deptMapper.getCompanyUserCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门树结构信息
|
||||
*
|
||||
|
|
@ -170,7 +203,18 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
@Override
|
||||
public SysDept selectDeptById(Long deptId)
|
||||
{
|
||||
return deptMapper.selectDeptById(deptId);
|
||||
SysDept sysDept = deptMapper.selectDeptById(deptId);
|
||||
if (systemConfig.isAddRootCompany() && Objects.nonNull(sysDept.getParentId()) && sysDept.getParentId().equals(0L)) {
|
||||
SysUser sysUser = deptMapper.selectCompanyAdminByDept(deptId);
|
||||
sysDept.setSysUser(sysUser);
|
||||
}
|
||||
return sysDept;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysDept selectActiveDeptById(Long deptId)
|
||||
{
|
||||
return deptMapper.selectActiveDeptById(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -259,22 +303,32 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertDept(SysDept dept)
|
||||
{
|
||||
//增加根公司的处理
|
||||
if (dept.getParentId() == null){
|
||||
dept.setParentId(0L);
|
||||
dept.setAncestors("0");
|
||||
}
|
||||
else {
|
||||
dept.setStatus("0");//默认启用
|
||||
int result = deptMapper.insertDept(dept);
|
||||
if (SecurityUtils.isAdmin(SecurityUtils.getUserId()) && systemConfig.isAddRootCompany() && result > 0) {
|
||||
if (StringUtils.isNotNull(dept.getSysUser()) && !userService.checkUserNameUnique(dept.getSysUser())) {
|
||||
throw new ServiceException("新增公司管理员用户'" + dept.getSysUser().getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
SysUser user = createCompanyAdminUser(dept);
|
||||
createCompanyAdminRole(dept, user);
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
||||
// 如果父节点不为正常状态,则不允许新增子节点
|
||||
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {
|
||||
throw new ServiceException("部门停用,不允许新增");
|
||||
}
|
||||
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
||||
return deptMapper.insertDept(dept);
|
||||
}
|
||||
return deptMapper.insertDept(dept);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -284,6 +338,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateDept(SysDept dept)
|
||||
{
|
||||
SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId());
|
||||
|
|
@ -302,6 +357,17 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
||||
updateParentDeptStatusNormal(dept);
|
||||
}
|
||||
//判断是否需要修改公司管理员用户信息
|
||||
if (SecurityUtils.isAdmin(SecurityUtils.getUserId()) && systemConfig.isAddRootCompany() && Objects.nonNull(dept.getParentId()) && dept.getParentId().equals(0L)){
|
||||
SysUser companyAdminUser = dept.getSysUser();
|
||||
if (Objects.nonNull(companyAdminUser.getRoleId())) {
|
||||
companyAdminUser.setUpdateBy(SecurityUtils.getUsername());
|
||||
companyAdminUser.setUpdateTime(DateUtils.getNowDate());
|
||||
roleMenuMapper.deleteRoleMenuByRoleId(companyAdminUser.getRoleId());
|
||||
batchInsertRoleMenuFromTemplate(dept, companyAdminUser.getRoleId());
|
||||
userMapper.updateUser(companyAdminUser);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -349,6 +415,17 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
return deptMapper.deleteDeptById(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 注销或恢复公司
|
||||
*
|
||||
* @param dept 当前公司
|
||||
*/
|
||||
@Override
|
||||
public int turnOnOffDeptById(SysDept dept)
|
||||
{
|
||||
return deptMapper.turnOnOffDeptById(dept);
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归列表
|
||||
*/
|
||||
|
|
@ -391,5 +468,63 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
{
|
||||
return getChildList(list, t).size() > 0 ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建公司管理员用户
|
||||
* @param dept
|
||||
*/
|
||||
private SysUser createCompanyAdminUser(SysDept dept) {
|
||||
log.info("创建公司管理员用户:{}",dept);
|
||||
SysUser user = dept.getSysUser();
|
||||
user.setCreateBy(SecurityUtils.getUsername());
|
||||
user.setPassword(SecurityUtils.encryptPassword(dept.getInitPassword()));
|
||||
user.setDeptId(dept.getDeptId());
|
||||
user.setLoginType("0"); //后台
|
||||
userMapper.insertUser(user);
|
||||
dept.setAdminUserId(user.getUserId());
|
||||
deptMapper.updateDept(dept);
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建公司管理员并分配角色菜单等
|
||||
*/
|
||||
private void createCompanyAdminRole(SysDept sysDept, SysUser user) {
|
||||
log.info("部门信息{},公司管理员用户{}",sysDept,user);
|
||||
SysRole role = new SysRole();
|
||||
role.setRoleKey("company_admin");
|
||||
role.setRoleName("公司管理员");
|
||||
role.setRemark("公司管理员");
|
||||
role.setCompanyId(sysDept.getDeptId());
|
||||
role.setRoleSort(0);
|
||||
role.setStatus("0");
|
||||
role.setCreateBy(SecurityUtils.getUsername());
|
||||
roleMapper.insertRole(role);
|
||||
log.info("创建的角色id为:{}",role.getRoleId());
|
||||
|
||||
//用户绑定角色
|
||||
SysUserRole sysUserRole = new SysUserRole();
|
||||
sysUserRole.setUserId(user.getUserId());
|
||||
sysUserRole.setRoleId(role.getRoleId());
|
||||
List<SysUserRole> sysUserRoleList = new ArrayList<SysUserRole>();
|
||||
sysUserRoleList.add(sysUserRole);
|
||||
userRoleMapper.batchUserRole(sysUserRoleList);
|
||||
|
||||
//对初始化管理员赋值菜单权限
|
||||
batchInsertRoleMenuFromTemplate(sysDept, role.getRoleId());
|
||||
}
|
||||
|
||||
private void batchInsertRoleMenuFromTemplate(SysDept sysDept, Long roleId) {
|
||||
List<SysRoleMenu> sysRoleMenulist = new ArrayList<>();
|
||||
List<Long> menuIds = sysTemplateMenuMapper.queryMenuIdByTemplateId(sysDept.getMenuTemplateId());
|
||||
SysRoleMenu sysRoleMenu = null;
|
||||
for (Long menuId : menuIds) {
|
||||
sysRoleMenu = new SysRoleMenu();
|
||||
sysRoleMenu.setRoleId(roleId);
|
||||
sysRoleMenu.setMenuId(menuId);
|
||||
sysRoleMenulist.add(sysRoleMenu);
|
||||
}
|
||||
roleMenuMapper.batchRoleMenu(sysRoleMenulist);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,10 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.bonus.system.api.domain.SysDept;
|
||||
import com.bonus.system.api.domain.SysMenu;
|
||||
import com.bonus.system.domain.UserMenuParams;
|
||||
import com.bonus.system.mapper.SysDeptMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.common.core.constant.Constants;
|
||||
|
|
@ -45,6 +47,9 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
@Autowired
|
||||
private SysRoleMenuMapper roleMenuMapper;
|
||||
|
||||
@Autowired
|
||||
private SysDeptMapper deptMapper;
|
||||
|
||||
/**
|
||||
* 根据用户查询系统菜单列表
|
||||
*
|
||||
|
|
@ -70,6 +75,8 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
String str = menu.getMenuName().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
||||
menu.setMenuName(str);
|
||||
}
|
||||
SysDept sysDept = deptMapper.selectDeptById(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
menu.setTemplateId(sysDept.getMenuTemplateId());
|
||||
List<SysMenu> menuList = menuMapper.selectMenuList(menu);
|
||||
return menuList;
|
||||
}
|
||||
|
|
@ -132,7 +139,8 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
}
|
||||
else
|
||||
{
|
||||
menus = menuMapper.selectMenuTreeByUserId(userId);
|
||||
SysDept sysDept = deptMapper.selectDeptById(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
menus = menuMapper.selectMenuTreeByUserId(userId, sysDept.getMenuTemplateId());
|
||||
}
|
||||
return getChildPerms(menus, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.system.service.impl;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.SysPost;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -43,7 +44,7 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
String str = post.getPostName().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
||||
post.setPostName(str);
|
||||
}
|
||||
|
||||
post.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
return postMapper.selectPostList(post);
|
||||
}
|
||||
|
||||
|
|
@ -55,7 +56,9 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
@Override
|
||||
public List<SysPost> selectPostAll()
|
||||
{
|
||||
return postMapper.selectPostAll();
|
||||
SysPost sysPost = new SysPost();
|
||||
sysPost.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
return postMapper.selectPostAll(sysPost);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -91,8 +94,10 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
@Override
|
||||
public boolean checkPostNameUnique(SysPost post)
|
||||
{
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
post.setCompanyId(companyId);
|
||||
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||
SysPost info = postMapper.checkPostNameUnique(post.getPostName());
|
||||
SysPost info = postMapper.checkPostNameUnique(post);
|
||||
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
|
|
@ -109,8 +114,10 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
@Override
|
||||
public boolean checkPostCodeUnique(SysPost post)
|
||||
{
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
post.setCompanyId(companyId);
|
||||
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||
SysPost info = postMapper.checkPostCodeUnique(post.getPostCode());
|
||||
SysPost info = postMapper.checkPostCodeUnique(post);
|
||||
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
|
|
|
|||
|
|
@ -60,8 +60,12 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
public List<SysRole> selectRoleList(SysRole role)
|
||||
{
|
||||
try {
|
||||
String beginTime = (String) role.getParams().get("beginTime");
|
||||
String endTime = (String) role.getParams().get("endTime");
|
||||
BaseEntity entity = CommonDataPermissionInfo.backMissionInfo(role.getParams().get("dataScope").toString());
|
||||
BeanUtils.copyProperties(entity, role);
|
||||
role.getParams().put("beginTime", beginTime);
|
||||
role.getParams().put("endTime", endTime);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
@ -73,6 +77,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
String str = role.getRoleKey().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
||||
role.setRoleKey(str);
|
||||
}
|
||||
role.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
return roleMapper.selectRoleList(role);
|
||||
}
|
||||
|
||||
|
|
@ -166,8 +171,10 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
@Override
|
||||
public boolean checkRoleNameUnique(SysRole role)
|
||||
{
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
role.setCompanyId(companyId);
|
||||
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||
SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
|
||||
SysRole info = roleMapper.checkRoleNameUnique(role);
|
||||
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
|
|
@ -184,8 +191,10 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
@Override
|
||||
public boolean checkRoleKeyUnique(SysRole role)
|
||||
{
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
role.setCompanyId(companyId);
|
||||
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||
SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
|
||||
SysRole info = roleMapper.checkRoleKeyUnique(role);
|
||||
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
|
|
@ -253,6 +262,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
public int insertRole(SysRole role)
|
||||
{
|
||||
// 新增角色信息
|
||||
role.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
roleMapper.insertRole(role);
|
||||
return insertRoleMenu(role);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,67 @@
|
|||
package com.bonus.system.service.impl;
|
||||
|
||||
import com.bonus.system.api.domain.SysTemplateMenu;
|
||||
import com.bonus.system.mapper.SysTemplateMenuMapper;
|
||||
import com.bonus.system.service.ISysTemplateMenuService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统模板菜单表(SysTempMenu)表服务实现类
|
||||
*
|
||||
* @author bonus
|
||||
* @since 2025-01-05
|
||||
*/
|
||||
@Service("sysTempMenuService")
|
||||
public class SysTemplateMenuServiceImpl implements ISysTemplateMenuService {
|
||||
@Resource
|
||||
private SysTemplateMenuMapper sysTemplateMenuMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询多条数据
|
||||
*
|
||||
* @param
|
||||
* @param
|
||||
* @return 对象列表
|
||||
*/
|
||||
@Override
|
||||
public List<Long> queryMenuIdByTemplateId(Long tempId) {
|
||||
return this.sysTemplateMenuMapper.queryMenuIdByTemplateId(tempId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param sysTemplateMenu
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SysTemplateMenu insert(SysTemplateMenu sysTemplateMenu) {
|
||||
this.sysTemplateMenuMapper.insert(sysTemplateMenu);
|
||||
return sysTemplateMenu;
|
||||
}
|
||||
|
||||
public int batchInsert(List<SysTemplateMenu> list) {
|
||||
int result = 0;
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
sysTemplateMenuMapper.deleteByTempId(list.get(0).getTempId());
|
||||
result = sysTemplateMenuMapper.batchInsert(list);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param sysTemplateMenu 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SysTemplateMenu update(SysTemplateMenu sysTemplateMenu) {
|
||||
this.sysTemplateMenuMapper.update(sysTemplateMenu);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
package com.bonus.system.service.impl;
|
||||
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.SysTemplate;
|
||||
import com.bonus.system.api.domain.SysTemplateMenu;
|
||||
import com.bonus.system.mapper.SysDeptMapper;
|
||||
import com.bonus.system.mapper.SysTemplateMapper;
|
||||
import com.bonus.system.mapper.SysTemplateMenuMapper;
|
||||
import com.bonus.system.service.ISysTemplateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限模板Service业务层处理
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2025-01-05
|
||||
*/
|
||||
@Service
|
||||
public class SysTemplateServiceImpl implements ISysTemplateService {
|
||||
|
||||
@Autowired
|
||||
private SysTemplateMapper sysTemplateMapper;
|
||||
|
||||
@Autowired
|
||||
private SysTemplateMenuMapper sysTemplateMenuMapper;
|
||||
|
||||
@Autowired
|
||||
SysDeptMapper sysDeptMapper;
|
||||
|
||||
/**
|
||||
* 查询权限模板
|
||||
*
|
||||
* @param id 权限模板ID
|
||||
* @return 权限模板
|
||||
*/
|
||||
@Override
|
||||
public SysTemplate selectSysTemplateById(Long id) {
|
||||
return sysTemplateMapper.selectSysTemplateById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询权限模板列表
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 权限模板
|
||||
*/
|
||||
@Override
|
||||
public List<SysTemplate> selectSysTemplateList(SysTemplate sysTemplate) {
|
||||
return sysTemplateMapper.selectSysTemplateList(sysTemplate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增权限模板
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertSysTemplate(SysTemplate sysTemplate) {
|
||||
sysTemplate.setCreateBy(SecurityUtils.getUsername());
|
||||
List<Long> menuIds = sysTemplate.getMenuIds();
|
||||
if (CollectionUtils.isEmpty(menuIds)) {
|
||||
throw new ServiceException("权限不能为空");
|
||||
}
|
||||
sysTemplateMapper.insertSysTemplate(sysTemplate);
|
||||
resetSysTempMenus(sysTemplate, menuIds);
|
||||
return resetSysTempMenus(sysTemplate, menuIds);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改权限模板
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateSysTemplate(SysTemplate sysTemplate) {
|
||||
sysTemplate.setUpdateBy(SecurityUtils.getUsername());
|
||||
List<Long> menuIds = sysTemplate.getMenuIds();
|
||||
if (CollectionUtils.isEmpty(menuIds)) {
|
||||
throw new ServiceException("权限不能为空");
|
||||
}
|
||||
resetSysTempMenus(sysTemplate, menuIds);
|
||||
return sysTemplateMapper.updateSysTemplate(sysTemplate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置模板对应的菜单
|
||||
*/
|
||||
private int resetSysTempMenus(SysTemplate sysTemplate, List<Long> menuIds) {
|
||||
sysTemplateMenuMapper.deleteByTempId(sysTemplate.getId());
|
||||
List<SysTemplateMenu> list = new ArrayList<>();
|
||||
SysTemplateMenu sysTempMenu = null;
|
||||
for (Long menuId : menuIds) {
|
||||
sysTempMenu = new SysTemplateMenu();
|
||||
sysTempMenu.setTempId(sysTemplate.getId());
|
||||
sysTempMenu.setMenuId(menuId);
|
||||
list.add(sysTempMenu);
|
||||
}
|
||||
return sysTemplateMenuMapper.batchInsert(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteSysTemplateByIds(Long[] ids) {
|
||||
for (Long tempId : ids) {
|
||||
Integer count = sysDeptMapper.getDeptCountByMenuTemplateId(tempId);
|
||||
if (null != count && count > 0) {
|
||||
SysTemplate sysTemplate = sysTemplateMapper.selectSysTemplateById(tempId);
|
||||
throw new ServiceException(sysTemplate.getName() + "下存在公司,请重新分配模板后再尝试删除");
|
||||
}
|
||||
sysTemplateMenuMapper.deleteByTempId(tempId);
|
||||
}
|
||||
return sysTemplateMapper.deleteSysTemplateByIds(ids);
|
||||
}
|
||||
}
|
||||
|
|
@ -109,6 +109,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||
String phone =user.getPhonenumber().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
||||
user.setPhonenumber(phone);
|
||||
}
|
||||
user.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
List<SysUser> sysUsers = userMapper.selectUserList(user);
|
||||
return sysUsers;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
<?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.bonus.system.mapper.SysAddressMapper">
|
||||
<resultMap type="com.bonus.system.api.domain.SysAddress" id="SysAddressResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="platformId" column="platform_id" />
|
||||
<result property="code" column="code" />
|
||||
<result property="parentCode" column="parent_code" />
|
||||
<result property="name" column="name" />
|
||||
<result property="latitude" column="latitude" />
|
||||
<result property="longitude" column="longitude" />
|
||||
<result property="level" column="level" />
|
||||
<result property="region" column="region" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysAddressVo">
|
||||
select id, platform_id, code, parent_code, name, latitude, longitude, level, region, create_time, update_time, del_flag from sys_address
|
||||
</sql>
|
||||
|
||||
<select id="selectSysAddressList" parameterType="com.bonus.system.api.domain.SysAddress" resultMap="SysAddressResult">
|
||||
<include refid="selectSysAddressVo"/>
|
||||
where parent_code = #{parentCode}
|
||||
</select>
|
||||
|
||||
<select id="selectSysAddressById" parameterType="Long" resultMap="SysAddressResult">
|
||||
<include refid="selectSysAddressVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -20,11 +20,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="menuTemplateId" column="menu_template_id" />
|
||||
<result property="province" column="province" />
|
||||
<result property="city" column="city" />
|
||||
<result property="district" column="district" />
|
||||
<result property="address" column="address" />
|
||||
|
||||
<result property="deptAbbreviation" column="dept_abbreviation" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="logo" column="logo" />
|
||||
<result property="adminUserId" column="admin_user_id" />
|
||||
<result property="initPassword" column="init_password" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeptVo">
|
||||
|
|
@ -39,17 +44,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.status,
|
||||
d.del_flag,
|
||||
d.create_by,
|
||||
d.create_time,
|
||||
d.province,
|
||||
d.city,
|
||||
d.district,
|
||||
d.address
|
||||
d.create_time
|
||||
from sys_dept d
|
||||
</sql>
|
||||
|
||||
<sql id="selectDeptVoWithMoreInfo">
|
||||
select d.dept_id,
|
||||
d.parent_id,
|
||||
d.ancestors,
|
||||
d.dept_name,
|
||||
d.order_num,
|
||||
d.leader,
|
||||
d.phone,
|
||||
d.email,
|
||||
d.status,
|
||||
d.del_flag,
|
||||
d.create_by,
|
||||
d.create_time,
|
||||
d.menu_template_id,
|
||||
d.province,
|
||||
d.city,
|
||||
d.district,
|
||||
d.address,
|
||||
d.dept_abbreviation,
|
||||
d.remark,
|
||||
d.logo,
|
||||
d.admin_user_id,
|
||||
d.init_password
|
||||
from sys_dept d
|
||||
</sql>
|
||||
|
||||
<select id="selectDeptList" parameterType="com.bonus.system.api.domain.SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where d.del_flag = '0'
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND (find_in_set(#{companyId}, ancestors) or dept_id = #{companyId})
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND dept_id = #{deptId}
|
||||
</if>
|
||||
|
|
@ -67,6 +97,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="getDeptList" resultType="com.bonus.system.api.domain.SysDept">
|
||||
select * from sys_dept sd where parent_id='0'
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND dept_id != #{companyId}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and sd.dept_name like concat('%', #{keyWord}, '%')
|
||||
</if>
|
||||
Order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectDeptUserList" resultType="com.bonus.system.api.domain.SysDept">
|
||||
SELECT
|
||||
d.dept_id AS deptId,
|
||||
|
|
@ -115,8 +156,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where dept_id = #{deptId}
|
||||
<include refid="selectDeptVoWithMoreInfo"/>
|
||||
where d.dept_id = #{deptId}
|
||||
</select>
|
||||
|
||||
<select id="selectActiveDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVoWithMoreInfo"/>
|
||||
where d.dept_id = #{deptId} and d.status = '0' and d.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
|
||||
|
|
@ -141,7 +187,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDept" parameterType="com.bonus.system.api.domain.SysDept">
|
||||
<insert id="insertDept" parameterType="com.bonus.system.api.domain.SysDept" useGeneratedKeys="true" keyProperty="deptId">
|
||||
insert into sys_dept(
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
|
|
@ -155,7 +201,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="city != null and city != ''">city,</if>
|
||||
<if test="district != null and district != ''">district,</if>
|
||||
<if test="address != null and address != ''">address,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="deptAbbreviation != null and deptAbbreviation != ''">dept_abbreviation,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="logo != null and logo != ''">logo,</if>
|
||||
<if test="initPassword != null and initPassword != ''">init_password,</if>
|
||||
<if test="menuTemplateId != null">menu_template_id,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
|
|
@ -171,7 +222,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="city != null and city != ''">#{city},</if>
|
||||
<if test="district != null and district != ''">#{district},</if>
|
||||
<if test="address != null and address != ''">#{address},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="deptAbbreviation != null and deptAbbreviation != ''">#{deptAbbreviation},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="logo != null and logo != ''">#{logo},</if>
|
||||
<if test="initPassword != null and initPassword != ''">#{initPassword},</if>
|
||||
<if test="menuTemplateId != null">#{menuTemplateId},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
|
|
@ -191,6 +247,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="city != null">city = #{city},</if>
|
||||
<if test="district != null">district = #{district},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="deptAbbreviation != null and deptAbbreviation != ''">dept_abbreviation = #{deptAbbreviation},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="logo != null and logo != ''">logo = #{logo},</if>
|
||||
<if test="adminUserId != null and adminUserId != 0">admin_user_id = #{adminUserId},</if>
|
||||
<if test="initPassword != null and initPassword != ''">init_password = #{initPassword},</if>
|
||||
<if test="menuTemplateId != null and menuTemplateId != ''">menu_template_id = #{menuTemplateId},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
|
|
@ -222,4 +284,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update sys_dept set del_flag = '2' where dept_id = #{deptId}
|
||||
</delete>
|
||||
|
||||
<delete id="turnOnOffDeptById" parameterType="com.bonus.system.api.domain.SysDept">
|
||||
update sys_dept set del_flag = #{delFlag} where dept_id = #{deptId}
|
||||
</delete>
|
||||
|
||||
<select id="getCompanyUserCount" resultType="com.bonus.system.api.domain.SysDept">
|
||||
SELECT
|
||||
CASE sd.ancestors
|
||||
WHEN ('0') THEN
|
||||
sd.dept_id
|
||||
ELSE
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(sd.ancestors, ',', 2), ',', -1)
|
||||
END as company_id,
|
||||
count(su.user_id) as user_count
|
||||
FROM `sys_user` su
|
||||
left join sys_dept sd on su.dept_id=sd.dept_id
|
||||
where su.del_flag='0'
|
||||
group by company_id
|
||||
</select>
|
||||
|
||||
<select id="selectCompanyAdminByDept" resultType="com.bonus.system.api.domain.SysUser">
|
||||
select su.nick_name as nickName, su.user_name as userName, su.phonenumber as phonenumber,
|
||||
su.user_id as userId, sd.dept_id as deptId, sur.role_id
|
||||
from sys_dept sd
|
||||
left join sys_user su on su.user_id = sd.admin_user_id
|
||||
left join sys_user_role sur on su.user_id = sur.user_id
|
||||
left join sys_role sr on sr.role_id = sur.role_id
|
||||
where sd.dept_id = #{deptId} and sr.role_key = 'company_admin'
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="getDeptCountByMenuTemplateId" resultType="Integer">
|
||||
SELECT count(1) FROM `sys_dept` where parent_id = 0 and menu_template_id = #{tempId} and del_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -29,21 +29,27 @@
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectMenuVo">
|
||||
select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time, system_type
|
||||
from sys_menu
|
||||
select sm.menu_id, sm.menu_name, sm.parent_id, sm.order_num, sm.path, sm.component, sm.`query`, sm.is_frame,
|
||||
sm.is_cache, sm.menu_type, sm.visible, sm.status, ifnull(sm.perms,'') as perms, sm.icon, sm.create_time, sm.system_type
|
||||
from sys_menu sm
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuList" parameterType="com.bonus.system.api.domain.SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
<where>
|
||||
<if test="menuName != null and menuName != ''">
|
||||
AND menu_name like concat('%', #{menuName}, '%')
|
||||
AND sm.menu_name like concat('%', #{menuName}, '%')
|
||||
</if>
|
||||
<if test="visible != null and visible != ''">
|
||||
AND visible = #{visible}
|
||||
AND sm.visible = #{visible}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
AND sm.status = #{status}
|
||||
</if>
|
||||
<if test="templateId != null">
|
||||
and exists (
|
||||
select 0 from sys_template_menu stm where stm.temp_id = #{templateId} and stm.menu_id = sm.menu_id
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
order by parent_id, order_num
|
||||
|
|
@ -71,10 +77,15 @@
|
|||
<if test="status != null and status != ''">
|
||||
AND m.status = #{status}
|
||||
</if>
|
||||
<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
|
||||
</select>
|
||||
|
||||
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
|
||||
<select id="selectMenuTreeByUserId" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
|
|
@ -82,6 +93,11 @@
|
|||
left join sys_role ro on ur.role_id = ro.role_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
|
||||
<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
|
||||
</select>
|
||||
|
||||
|
|
@ -93,6 +109,11 @@
|
|||
left join sys_role ro on ur.role_id = ro.role_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)
|
||||
<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
|
||||
</select>
|
||||
|
||||
|
|
@ -132,7 +153,7 @@
|
|||
|
||||
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where menu_id = #{menuId}
|
||||
where sm.menu_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<select id="hasChildByMenuId" resultType="Integer">
|
||||
|
|
@ -141,7 +162,7 @@
|
|||
|
||||
<select id="checkMenuNameUnique" parameterType="com.bonus.system.api.domain.SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
||||
where sm.menu_name=#{menuName} and sm.parent_id = #{parentId} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updateMenu" parameterType="com.bonus.system.api.domain.SysMenu">
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="postCode" column="post_code" />
|
||||
<result property="postName" column="post_name" />
|
||||
<result property="postSort" column="post_sort" />
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
|
|
@ -18,13 +19,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectPostVo">
|
||||
select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
|
||||
select post_id, post_code, post_name, post_sort, company_id, status, create_by, create_time, remark
|
||||
from sys_post
|
||||
</sql>
|
||||
|
||||
<select id="selectPostList" parameterType="com.bonus.system.api.domain.SysPost" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
<where>
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND company_id = #{companyId}
|
||||
</if>
|
||||
<if test="postCode != null and postCode != ''">
|
||||
AND post_code like concat('%', #{postCode}, '%')
|
||||
</if>
|
||||
|
|
@ -38,8 +42,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by post_sort
|
||||
</select>
|
||||
|
||||
<select id="selectPostAll" resultMap="SysPostResult">
|
||||
<select id="selectPostAll" parameterType="com.bonus.system.api.domain.SysPost" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where 1=1
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND company_id = #{companyId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
|
||||
|
|
@ -56,21 +64,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
|
||||
select p.post_id, p.post_name, p.post_code
|
||||
select p.post_id, p.post_name, p.post_code, p.company_id
|
||||
from sys_post p
|
||||
left join sys_user_post up on up.post_id = p.post_id
|
||||
left join sys_user u on u.user_id = up.user_id
|
||||
where u.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<select id="checkPostNameUnique" parameterType="com.bonus.system.api.domain.SysPost" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_name=#{postName} limit 1
|
||||
where post_name=#{postName}
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND company_id = #{companyId}
|
||||
</if>
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<select id="checkPostCodeUnique" parameterType="com.bonus.system.api.domain.SysPost" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_code=#{postCode} limit 1
|
||||
where post_code=#{postCode}
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND company_id = #{companyId}
|
||||
</if>
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<update id="updatePost" parameterType="com.bonus.system.api.domain.SysPost">
|
||||
|
|
@ -79,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
||||
<if test="postName != null and postName != ''">post_name = #{postName},</if>
|
||||
<if test="postSort != null">post_sort = #{postSort},</if>
|
||||
<if test="companyId != null">company_id = #{companyId},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
|
|
@ -93,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="postCode != null and postCode != ''">post_code,</if>
|
||||
<if test="postName != null and postName != ''">post_name,</if>
|
||||
<if test="postSort != null">post_sort,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
|
|
@ -102,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="postCode != null and postCode != ''">#{postCode},</if>
|
||||
<if test="postName != null and postName != ''">#{postName},</if>
|
||||
<if test="postSort != null">#{postSort},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="dataScope" column="data_scope" />
|
||||
<result property="menuCheckStrictly" column="menu_check_strictly" />
|
||||
<result property="deptCheckStrictly" column="dept_check_strictly" />
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
|
|
@ -24,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<sql id="selectRoleVo">
|
||||
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
|
||||
r.status, r.del_flag, r.create_time, r.remark, r.is_built_in
|
||||
r.company_id, r.status, r.del_flag, r.create_time, r.remark, r.is_built_in
|
||||
from sys_role r
|
||||
left join sys_user_role ur on ur.role_id = r.role_id
|
||||
left join sys_user u on u.user_id = ur.user_id
|
||||
|
|
@ -40,6 +41,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="roleName != null and roleName != ''">
|
||||
AND r.role_name like concat('%', #{roleName}, '%')
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
AND r.company_id = #{companyId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND r.status = #{status}
|
||||
</if>
|
||||
|
|
@ -84,14 +88,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE r.del_flag = '0' and u.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
||||
<select id="checkRoleNameUnique" parameterType="com.bonus.system.api.domain.SysRole" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_name=#{roleName} and r.del_flag = '0' limit 1
|
||||
where r.role_name=#{roleName} and r.del_flag = '0'
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND company_id = #{companyId}
|
||||
</if>
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
||||
<select id="checkRoleKeyUnique" parameterType="com.bonus.system.api.domain.SysRole" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
|
||||
where r.role_key=#{roleKey} and r.del_flag = '0'
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND company_id = #{companyId}
|
||||
</if>
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertRole" parameterType="com.bonus.system.api.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||
|
|
@ -103,6 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="dataScope != null and dataScope != ''">data_scope,</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly,</if>
|
||||
<if test="deptCheckStrictly != null">dept_check_strictly,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
|
|
@ -116,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
|
||||
<if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
|
||||
<if test="deptCheckStrictly != null">#{deptCheckStrictly},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
|
|
@ -133,6 +147,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if>
|
||||
<if test="deptCheckStrictly != null">dept_check_strictly = #{deptCheckStrictly},</if>
|
||||
<if test="companyId != null">company_id = #{companyId},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
<?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.bonus.system.mapper.SysTemplateMapper">
|
||||
|
||||
<resultMap type="com.bonus.system.api.domain.SysTemplate" id="SysTemplateResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysTemplateVo">
|
||||
select id, name, remark, create_by, create_time, update_by, update_time from sys_template
|
||||
</sql>
|
||||
|
||||
<select id="selectSysTemplateList" parameterType="com.bonus.system.api.domain.SysTemplate" resultMap="SysTemplateResult">
|
||||
<include refid="selectSysTemplateVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysTemplateById" parameterType="Long" resultMap="SysTemplateResult">
|
||||
<include refid="selectSysTemplateVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysTemplate" parameterType="com.bonus.system.api.domain.SysTemplate" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_template
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysTemplate" parameterType="com.bonus.system.api.domain.SysTemplate">
|
||||
update sys_template
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysTemplateById" parameterType="java.lang.String">
|
||||
delete from sys_template where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysTemplateByIds" parameterType="Long">
|
||||
delete from sys_template where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
<?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.bonus.system.mapper.SysTemplateMenuMapper">
|
||||
|
||||
<resultMap type="com.bonus.system.api.domain.SysTemplateMenu" id="SysTemplateMenuMap">
|
||||
<result property="tempId" column="temp_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
</resultMap>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="SysTemplateMenuMap">
|
||||
select
|
||||
temp_id, menu_id
|
||||
from sys_template_menu
|
||||
limit #{offset}, #{limit}
|
||||
</select>
|
||||
|
||||
<!--通过实体作为筛选条件查询-->
|
||||
<select id="queryMenuIdByTemplateId" resultType="Long">
|
||||
select
|
||||
menu_id
|
||||
from
|
||||
sys_template_menu
|
||||
where
|
||||
temp_id = #{tempId}
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="" useGeneratedKeys="true">
|
||||
insert into sys_template_menu(temp_id, menu_id)
|
||||
values (#{tempId}, #{menuId})
|
||||
</insert>
|
||||
|
||||
<insert id="batchInsert">
|
||||
insert into sys_template_menu(temp_id, menu_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.tempId},#{item.menuId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update sys_template_menu
|
||||
<set>
|
||||
<if test="tempId != null">
|
||||
temp_id = #{tempId},
|
||||
</if>
|
||||
<if test="menuId != null">
|
||||
menu_id = #{menuId},
|
||||
</if>
|
||||
</set>
|
||||
where = #{}
|
||||
</update>
|
||||
|
||||
<delete id="deleteByTempId" parameterType="Long">
|
||||
delete from sys_template_menu where temp_id = #{tempId}
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -130,6 +130,9 @@
|
|||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND (find_in_set(#{companyId}, ancestors) or u.dept_id = #{companyId})
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
|
||||
ancestors) ))
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
SET NAMES utf8mb4;
|
||||
|
||||
-- 省
|
||||
alter table sys_dept add province varchar(50) null comment '省';
|
||||
-- 市
|
||||
alter table sys_dept add city varchar(50) null comment '市';
|
||||
-- 县
|
||||
alter table sys_dept add district varchar(50) null comment '县';
|
||||
-- 详细地址
|
||||
alter table sys_dept add address varchar(255) null comment '详细地址';
|
||||
-- 公司简称
|
||||
alter table sys_dept add dept_abbreviation varchar(255) null comment '公司简称';
|
||||
-- 公司概述
|
||||
alter table sys_dept add remark varchar(255) null comment '公司概述';
|
||||
-- 公司logo
|
||||
alter table sys_dept add logo varchar(255) null comment '公司logo';
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
-- 菜单模版ID
|
||||
alter table sys_dept add menu_template_id bigint(20) null comment '菜单模版ID';
|
||||
-- 公司管理员用户ID
|
||||
alter table sys_dept add admin_user_id bigint(20) null comment '公司管理员用户ID';
|
||||
-- 公司用户初始密码
|
||||
alter table sys_dept add init_password varchar(255) null comment '公司用户初始密码';
|
||||
-- 省
|
||||
alter table sys_dept add province varchar(50) null comment '省';
|
||||
-- 市
|
||||
alter table sys_dept add city varchar(50) null comment '市';
|
||||
-- 县
|
||||
alter table sys_dept add district varchar(50) null comment '县';
|
||||
-- 详细地址
|
||||
alter table sys_dept add address varchar(255) null comment '详细地址';
|
||||
-- 公司简称
|
||||
alter table sys_dept add dept_abbreviation varchar(255) null comment '公司简称';
|
||||
-- 公司概述
|
||||
alter table sys_dept add remark varchar(255) null comment '公司概述';
|
||||
-- 公司logo
|
||||
alter table sys_dept add logo varchar(255) null comment '公司logo';
|
||||
|
||||
|
||||
-- 所属公司ID
|
||||
alter table sys_role add company_id bigint null comment '所属公司ID';
|
||||
|
||||
-- 所属公司ID
|
||||
alter table sys_post add company_id bigint null comment '所属公司ID';
|
||||
|
||||
|
||||
INSERT INTO `sys_menu` (menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark, system_type) VALUES (12098, '公司管理', 12103, 0, 'company-manage', 'company-manage', null, 1, 1, 'C', '0', '0', 'system:dept:list', 'cascader', 'admin', '2024-12-31 09:30:21', 'admin', '2025-01-08 17:49:16', '', '0');
|
||||
INSERT INTO `sys_menu` (menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark, system_type) VALUES (12099, '公司查询', 12098, 1, '', null, null, 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', '2025-01-02 13:18:27', 'admin', '2025-01-02 13:21:39', '', '0');
|
||||
INSERT INTO `sys_menu` (menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark, system_type) VALUES (12100, '公司新增', 12098, 2, '', null, null, 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', '2025-01-02 13:19:24', '', null, '', '0');
|
||||
INSERT INTO `sys_menu` (menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark, system_type) VALUES (12101, '公司修改', 12098, 3, '', null, null, 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', '2025-01-02 13:19:51', 'admin', '2025-01-02 13:20:19', '', '0');
|
||||
INSERT INTO `sys_menu` (menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark, system_type) VALUES (12102, '公司删除', 12098, 4, '', null, null, 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', '2025-01-02 13:21:19', '', null, '', '0');
|
||||
INSERT INTO `sys_menu` (menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark, system_type) VALUES (12103, '平台管理', 0, 97, 'platform', null, null, 1, 0, 'M', '1', '0', '', 'international', 'admin', '2025-01-05 09:30:33', 'admin', '2025-01-08 09:51:49', '', '0,1,2');
|
||||
INSERT INTO `sys_menu` (menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark, system_type) VALUES (12104, '权限模板', 12103, 1, 'menu/template', 'permission-template', null, 1, 1, 'C', '0', '0', '', 'client', 'admin', '2025-01-05 09:35:15', 'admin', '2025-01-08 17:50:04', '', '0');
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue