基础多租户改造完成

This commit is contained in:
zhanghan11 2024-03-22 15:28:50 +08:00
parent 9693e1b542
commit 4c2cce3965
44 changed files with 1801 additions and 186 deletions

View File

@ -60,6 +60,12 @@
<groupId>com.inspur</groupId>
<artifactId>inspur-generator</artifactId>
</dependency>
<dependency>
<groupId>com.inspur</groupId>
<artifactId>inspur-om</artifactId>
<version>3.8.7</version>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -16,6 +16,6 @@ public class InspurApplication
{
// System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(InspurApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 浪潮启动成功 ლ(´ڡ`ლ)゙ ");
System.out.println("装备运维知识服务平台启动成功 ");
}
}

View File

@ -0,0 +1,104 @@
package com.inspur.web.controller.om;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.inspur.common.annotation.Log;
import com.inspur.common.core.controller.BaseController;
import com.inspur.common.core.domain.AjaxResult;
import com.inspur.common.enums.BusinessType;
import com.inspur.om.domain.OmTeamInfo;
import com.inspur.om.service.IOmTeamInfoService;
import com.inspur.common.utils.poi.ExcelUtil;
import com.inspur.common.core.page.TableDataInfo;
/**
* 运维团队信息管理Controller
*
* @author inspur
* @date 2024-03-20
*/
@RestController
@RequestMapping("/om/teamInfo")
public class OmTeamInfoController extends BaseController
{
@Autowired
private IOmTeamInfoService omTeamInfoService;
/**
* 查询运维团队信息管理列表
*/
@PreAuthorize("@ss.hasPermi('om:teamInfo:list')")
@GetMapping("/list")
public TableDataInfo list(OmTeamInfo omTeamInfo)
{
startPage();
List<OmTeamInfo> list = omTeamInfoService.selectOmTeamInfoList(omTeamInfo);
return getDataTable(list);
}
/**
* 导出运维团队信息管理列表
*/
@PreAuthorize("@ss.hasPermi('om:teamInfo:export')")
@Log(title = "运维团队信息管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, OmTeamInfo omTeamInfo)
{
List<OmTeamInfo> list = omTeamInfoService.selectOmTeamInfoList(omTeamInfo);
ExcelUtil<OmTeamInfo> util = new ExcelUtil<OmTeamInfo>(OmTeamInfo.class);
util.exportExcel(response, list, "运维团队信息管理数据");
}
/**
* 获取运维团队信息管理详细信息
*/
@PreAuthorize("@ss.hasPermi('om:teamInfo:query')")
@GetMapping(value = "/{teamId}")
public AjaxResult getInfo(@PathVariable("teamId") String teamId)
{
return success(omTeamInfoService.selectOmTeamInfoByTeamId(teamId));
}
/**
* 新增运维团队信息管理
*/
@PreAuthorize("@ss.hasPermi('om:teamInfo:add')")
@Log(title = "运维团队信息管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody OmTeamInfo omTeamInfo)
{
return AjaxResult.success(omTeamInfoService.insertOmTeamInfo(omTeamInfo));
}
/**
* 修改运维团队信息管理
*/
@PreAuthorize("@ss.hasPermi('om:teamInfo:edit')")
@Log(title = "运维团队信息管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody OmTeamInfo omTeamInfo)
{
return toAjax(omTeamInfoService.updateOmTeamInfo(omTeamInfo));
}
/**
* 删除运维团队信息管理
*/
@PreAuthorize("@ss.hasPermi('om:teamInfo:remove')")
@Log(title = "运维团队信息管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{teamIds}")
public AjaxResult remove(@PathVariable String[] teamIds)
{
return toAjax(omTeamInfoService.deleteOmTeamInfoByTeamIds(teamIds));
}
}

View File

@ -113,7 +113,7 @@ public class SwaggerConfig
// 用ApiInfoBuilder进行定制
return new ApiInfoBuilder()
// 设置标题
.title("标题:浪潮管理系统_接口文档")
.title("标题:装备运维知识服务平台_接口文档")
// 描述
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
// 作者信息

View File

@ -6,7 +6,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/inspur-multi-tenant-template?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:3306/eomksp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
# 从库数据源

View File

@ -3,11 +3,14 @@ not.null=* 必须填写
user.jcaptcha.error=验证码错误
user.jcaptcha.expire=验证码已失效
user.not.exists=用户不存在/密码错误
tenant.not.exists=团队不存在
user.password.not.match=用户不存在/密码错误
user.password.retry.limit.count=密码输入错误{0}次
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
user.password.delete=对不起,您的账号已被删除
tenant.password.delete=对不起,该团队已被删除
user.blocked=用户已封禁,请联系管理员
tenant.blocked=团队已封禁,请联系管理员
role.blocked=角色已封禁,请联系管理员
login.blocked=很遗憾访问IP已被列入系统黑名单
user.logout.success=退出成功
@ -16,7 +19,7 @@ length.not.valid=长度必须在{min}到{max}个字符之间
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成且必须以非数字开头
user.password.not.valid=* 5-50个字符
user.email.not.valid=邮箱格式错误
user.mobile.phone.number.not.valid=手机号格式错误
user.login.success=登录成功

View File

@ -10,35 +10,35 @@ public class CacheConstants
/**
* 登录用户 redis key
*/
public static final String LOGIN_TOKEN_KEY = "inspur_multi_tenant_template_login_tokens:";
public static final String LOGIN_TOKEN_KEY = "eomksp_login_tokens:";
/**
* 验证码 redis key
*/
public static final String CAPTCHA_CODE_KEY = "inspur_multi_tenant_template_captcha_codes:";
public static final String CAPTCHA_CODE_KEY = "eomksp_captcha_codes:";
/**
* 参数管理 cache key
*/
public static final String SYS_CONFIG_KEY = "inspur_multi_tenant_template_sys_config:";
public static final String SYS_CONFIG_KEY = "eomksp_sys_config:";
/**
* 字典管理 cache key
*/
public static final String SYS_DICT_KEY = "inspur_multi_tenant_template_sys_dict:";
public static final String SYS_DICT_KEY = "eomksp_sys_dict:";
/**
* 防重提交 redis key
*/
public static final String REPEAT_SUBMIT_KEY = "inspur_multi_tenant_template_repeat_submit:";
public static final String REPEAT_SUBMIT_KEY = "eomksp_repeat_submit:";
/**
* 限流 redis key
*/
public static final String RATE_LIMIT_KEY = "inspur_multi_tenant_template_rate_limit:";
public static final String RATE_LIMIT_KEY = "eomksp_rate_limit:";
/**
* 登录账户密码错误次数 redis key
*/
public static final String PWD_ERR_CNT_KEY = "inspur_multi_tenant_template_pwd_err_cnt:";
public static final String PWD_ERR_CNT_KEY = "eomksp_pwd_err_cnt:";
}

View File

@ -102,7 +102,7 @@ public class Constants
/**
* 令牌前缀
*/
public static final String LOGIN_USER_KEY = "inspur_multi_tenant_template_login_user_key";
public static final String LOGIN_USER_KEY = "eomksp_login_user_key";
/**
* 用户ID

View File

@ -0,0 +1,61 @@
package com.inspur.common.constant;
/**
* 运维管理系统 常量
*/
public class OmConstants {
/**
* 运维申请流程状态 OMA
*/
/**
* 编辑中
*/
public static final String OMA_EDITINT = "0";
/**
* 资料审查
*/
public static final String OMA_INFO_REVIEW = "1";
/**
* 资料审查未通过
*/
public static final String OMA_INFO_REVIEW_FAIL = "2";
/**
* 合规性审查
*/
public static final String OMA_COMPLIANCE_REVIEW = "3";
/**
* 合规性审查未通过
*/
public static final String OMA_COMPLIANCE_REVIEW_FAIL = "4";
/**
* 审核通过
*/
public static final String OMA_REVIEW_PASS = "5";
/**
* 结束
*/
public static final String OMA_FINISH = "6";
/**
* 组织机构根节点id
*/
public static final Long ORG_ROOT_ID = 100L;
/**
* 组织机构根节点名称
*/
public static final String ORG_ROOT_NAME = "装备运维知识服务平台";
/**
* 组织机构根节点显示顺序
*/
public static final int ORG_ROOT_ORDER = 0;
/**
* 租户id前缀
*/
public static final String TENANT_ID_PREFIX = "00000000";
/**
* 租户id长度
*/
public static final int TENANT_ID_LEHGTH = 8;
}

View File

@ -2,7 +2,7 @@ package com.inspur.common.constant;
/**
* 用户常量信息
*
*
* @author inspur
*/
public class UserConstants
@ -53,7 +53,7 @@ public class UserConstants
/** Layout组件标识 */
public final static String LAYOUT = "Layout";
/** ParentView组件标识 */
public final static String PARENT_VIEW = "ParentView";
@ -75,4 +75,9 @@ public class UserConstants
*/
public static final int PASSWORD_MIN_LENGTH = 5;
public static final int PASSWORD_MAX_LENGTH = 20;
/** 超级管理员角色ID */
public static final Long SUPER_ADMIN_ROLE_ID = 1L;
/** 运维团队管理员角色ID */
public static final Long OTM_ADMIN_ROLE_ID = 2L;
}

View File

@ -58,7 +58,11 @@
<groupId>com.inspur</groupId>
<artifactId>inspur-system</artifactId>
</dependency>
<!-- 运维团队管理模块-->
<dependency>
<groupId>com.inspur</groupId>
<artifactId>inspur-om</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,6 +1,8 @@
package com.inspur.framework.web.service;
import com.inspur.framework.security.context.AuthenticationContextHolder;
import com.inspur.om.domain.OmTeamInfo;
import com.inspur.om.service.IOmTeamInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -36,11 +38,29 @@ public class UserDetailsServiceImpl implements UserDetailsService
@Autowired
private SysPermissionService permissionService;
@Autowired
private IOmTeamInfoService omTeamInfoService;
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException
{
Authentication usernamePasswordAuthenticationToken = AuthenticationContextHolder.getContext();
String tenantId = usernamePasswordAuthenticationToken.getDetails().toString();
// 校验当前租户是否停用或已删除
OmTeamInfo omTeamInfo = omTeamInfoService.selectOmTeamInfoByTenantId(tenantId);
if(StringUtils.isNull(omTeamInfo)){
log.info("团队:{} 不存在.", tenantId);
throw new ServiceException(MessageUtils.message("tenant.not.exists"));
}else if (UserStatus.DELETED.getCode().equals(omTeamInfo.getDelFlag()))
{
log.info("团队:{} 已被删除.", tenantId);
throw new ServiceException(MessageUtils.message("tenant.password.delete"));
}
else if (UserStatus.DISABLE.getCode().equals(omTeamInfo.getStatus()))
{
log.info("团队:{} 已被停用.", tenantId);
throw new ServiceException(MessageUtils.message("tenant.blocked"));
}
SysUser user = userService.selectUserByUserName(tenantId,username);
if (StringUtils.isNull(user))
{

View File

@ -215,7 +215,7 @@ public class GenUtils
*/
public static String replaceText(String text)
{
return RegExUtils.replaceAll(text, "(?:表|浪潮)", "");
return RegExUtils.replaceAll(text, "(?:表|装备运维知识服务平台)", "");
}
/**

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>inspur</artifactId>
<groupId>com.inspur</groupId>
<version>3.8.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>inspur-om</artifactId>
<description>
运营团队管理系统模块
</description>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.inspur</groupId>
<artifactId>inspur-common</artifactId>
</dependency>
<!-- 系统模块-->
<dependency>
<groupId>com.inspur</groupId>
<artifactId>inspur-system</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,166 @@
package com.inspur.om.domain;
import com.inspur.common.annotation.Excel;
import com.inspur.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 运维团队信息管理对象 om_team_info
*
* @author inspur
* @date 2024-03-20
*/
public class OmTeamInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private String teamId;
/** 团队名称 */
@Excel(name = "团队名称")
private String teamName;
/** 联系人 */
@Excel(name = "联系人")
private String contacts;
/** 联系电话 */
@Excel(name = "联系电话")
private String telephone;
/** 邮箱 */
@Excel(name = "邮箱")
private String mail;
/** 业务类型 */
@Excel(name = "业务类型")
private String businessType;
/** 领域 */
@Excel(name = "领域")
private String field;
/** 工作范围 */
@Excel(name = "工作范围")
private String workScope;
/** 是否在用 0 停用1 在用 */
@Excel(name = "是否在用 0 停用1 在用")
private String status;
/** 删除标志0代表存在 2代表删除 */
@Excel(name = "删除标志0代表存在 2代表删除")
private String delFlag;
public void setTeamId(String teamId)
{
this.teamId = teamId;
}
public String getTeamId()
{
return teamId;
}
public void setTeamName(String teamName)
{
this.teamName = teamName;
}
public String getTeamName()
{
return teamName;
}
public void setContacts(String contacts)
{
this.contacts = contacts;
}
public String getContacts()
{
return contacts;
}
public void setTelephone(String telephone)
{
this.telephone = telephone;
}
public String getTelephone()
{
return telephone;
}
public void setMail(String mail)
{
this.mail = mail;
}
public String getMail()
{
return mail;
}
public void setBusinessType(String businessType)
{
this.businessType = businessType;
}
public String getBusinessType()
{
return businessType;
}
public void setField(String field)
{
this.field = field;
}
public String getField()
{
return field;
}
public void setWorkScope(String workScope)
{
this.workScope = workScope;
}
public String getWorkScope()
{
return workScope;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("teamId", getTeamId())
.append("teamName", getTeamName())
.append("contacts", getContacts())
.append("telephone", getTelephone())
.append("mail", getMail())
.append("businessType", getBusinessType())
.append("field", getField())
.append("workScope", getWorkScope())
.append("status", getStatus())
.append("delFlag", getDelFlag())
.append("tenantId", getTenantId())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,76 @@
package com.inspur.om.mapper;
import java.util.List;
import com.inspur.om.domain.OmTeamInfo;
/**
* 运维团队信息管理Mapper接口
*
* @author inspur
* @date 2024-03-20
*/
public interface OmTeamInfoMapper
{
/**
* 查询运维团队信息管理
*
* @param teamId 运维团队信息管理主键
* @return 运维团队信息管理
*/
public OmTeamInfo selectOmTeamInfoByTeamId(String teamId);
/**
* 查询运维团队信息管理列表
*
* @param omTeamInfo 运维团队信息管理
* @return 运维团队信息管理集合
*/
public List<OmTeamInfo> selectOmTeamInfoList(OmTeamInfo omTeamInfo);
/**
* 新增运维团队信息管理
*
* @param omTeamInfo 运维团队信息管理
* @return 结果
*/
public int insertOmTeamInfo(OmTeamInfo omTeamInfo);
/**
* 修改运维团队信息管理
*
* @param omTeamInfo 运维团队信息管理
* @return 结果
*/
public int updateOmTeamInfo(OmTeamInfo omTeamInfo);
/**
* 删除运维团队信息管理
*
* @param teamId 运维团队信息管理主键
* @return 结果
*/
public int deleteOmTeamInfoByTeamId(String teamId);
/**
* 批量删除运维团队信息管理
*
* @param teamIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteOmTeamInfoByTeamIds(String[] teamIds);
/**
* 查询运维团队信息管理
*
* @param tenantId 租户id
* @return 运维团队信息管理
*/
public OmTeamInfo selectOmTeamInfoByTenantId(String tenantId);
/**
* 查询下一租户id
*
* @return 租户id
*/
String selectNextTenantId();
}

View File

@ -0,0 +1,71 @@
package com.inspur.om.service;
import java.util.List;
import java.util.Map;
import com.inspur.om.domain.OmTeamInfo;
/**
* 运维团队信息管理Service接口
*
* @author inspur
* @date 2024-03-20
*/
public interface IOmTeamInfoService
{
/**
* 查询运维团队信息管理
*
* @param teamId 运维团队信息管理主键
* @return 运维团队信息管理
*/
public OmTeamInfo selectOmTeamInfoByTeamId(String teamId);
/**
* 查询运维团队信息管理列表
*
* @param omTeamInfo 运维团队信息管理
* @return 运维团队信息管理集合
*/
public List<OmTeamInfo> selectOmTeamInfoList(OmTeamInfo omTeamInfo);
/**
* 新增运维团队信息管理
*
* @param omTeamInfo 运维团队信息管理
* @return 结果
*/
public Map<String,String> insertOmTeamInfo(OmTeamInfo omTeamInfo);
/**
* 修改运维团队信息管理
*
* @param omTeamInfo 运维团队信息管理
* @return 结果
*/
public int updateOmTeamInfo(OmTeamInfo omTeamInfo);
/**
* 批量删除运维团队信息管理
*
* @param teamIds 需要删除的运维团队信息管理主键集合
* @return 结果
*/
public int deleteOmTeamInfoByTeamIds(String[] teamIds);
/**
* 删除运维团队信息管理信息
*
* @param teamId 运维团队信息管理主键
* @return 结果
*/
public int deleteOmTeamInfoByTeamId(String teamId);
/**
* 查询运维团队信息管理
*
* @param tenantId 租户id
* @return 运维团队信息管理
*/
public OmTeamInfo selectOmTeamInfoByTenantId(String tenantId);
}

View File

@ -0,0 +1,178 @@
package com.inspur.om.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.inspur.common.constant.OmConstants;
import com.inspur.common.constant.UserConstants;
import com.inspur.common.core.domain.entity.SysDept;
import com.inspur.common.core.domain.entity.SysUser;
import com.inspur.common.utils.DateUtils;
import com.inspur.common.utils.SecurityUtils;
import com.inspur.common.utils.uuid.IdUtils;
import com.inspur.system.service.ISysDeptService;
import com.inspur.system.service.ISysPostService;
import com.inspur.system.service.ISysRoleService;
import com.inspur.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.inspur.om.mapper.OmTeamInfoMapper;
import com.inspur.om.domain.OmTeamInfo;
import com.inspur.om.service.IOmTeamInfoService;
import org.springframework.transaction.annotation.Transactional;
/**
* 运维团队信息管理Service业务层处理
*
* @author inspur
* @date 2024-03-20
*/
@Service
public class OmTeamInfoServiceImpl implements IOmTeamInfoService
{
@Autowired
private OmTeamInfoMapper omTeamInfoMapper;
@Autowired
private ISysDeptService sysDeptService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private ISysRoleService sysRoleService;
@Autowired
private ISysPostService syspostService;
/**
* 查询运维团队信息管理
*
* @param teamId 运维团队信息管理主键
* @return 运维团队信息管理
*/
@Override
public OmTeamInfo selectOmTeamInfoByTeamId(String teamId)
{
return omTeamInfoMapper.selectOmTeamInfoByTeamId(teamId);
}
/**
* 查询运维团队信息管理列表
*
* @param omTeamInfo 运维团队信息管理
* @return 运维团队信息管理
*/
@Override
public List<OmTeamInfo> selectOmTeamInfoList(OmTeamInfo omTeamInfo)
{
return omTeamInfoMapper.selectOmTeamInfoList(omTeamInfo);
}
/**
* 新增运维团队信息管理
*
* @param omTeamInfo 运维团队信息管理
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Map<String,String> insertOmTeamInfo(OmTeamInfo omTeamInfo)
{
Map<String,String> returnMap = new HashMap<>();
// 查询下一租户id
String tenantId= omTeamInfoMapper.selectNextTenantId();
tenantId = OmConstants.TENANT_ID_PREFIX.substring(0,OmConstants.TENANT_ID_LEHGTH-tenantId.length())+tenantId;
// 新增运维团队信息
omTeamInfo.setTenantId(tenantId);
omTeamInfo.setTeamId(IdUtils.fastSimpleUUID());
omTeamInfo.setCreateTime(DateUtils.getNowDate());
omTeamInfoMapper.insertOmTeamInfo(omTeamInfo);
// 新增部门
SysDept dept = new SysDept();
dept.setTenantId(tenantId);
dept.setDeptName(omTeamInfo.getTeamName());
dept.setLeader(omTeamInfo.getContacts());
dept.setPhone(omTeamInfo.getTelephone());
dept.setEmail(omTeamInfo.getMail());
dept.setParentId(OmConstants.ORG_ROOT_ID);
dept.setOrderNum(OmConstants.ORG_ROOT_ORDER);
sysDeptService.insertDept(dept);
// 新增用户
SysUser sysUser = new SysUser();
sysUser.setUserName(omTeamInfo.getTeamName());
sysUser.setPassword(SecurityUtils.encryptPassword(omTeamInfo.getTeamId().substring(5,15)));
sysUser.setDeptId(dept.getDeptId());
sysUser.setNickName(omTeamInfo.getTeamName());
Long[] roleIds={UserConstants.OTM_ADMIN_ROLE_ID};
sysUser.setRoleIds(roleIds);
sysUser.setTenantId(tenantId);
sysUserService.insertUser(sysUser);
returnMap.put("userName",sysUser.getUserName());
returnMap.put("password",sysUser.getPassword());
return returnMap;
}
/**
* 修改运维团队信息管理
*
* @param omTeamInfo 运维团队信息管理
* @return 结果
*/
@Override
public int updateOmTeamInfo(OmTeamInfo omTeamInfo)
{
omTeamInfo.setUpdateTime(DateUtils.getNowDate());
omTeamInfo.setUpdateBy(SecurityUtils.getUserId().toString());
return omTeamInfoMapper.updateOmTeamInfo(omTeamInfo);
}
/**
* 批量删除运维团队信息管理
*
* @param teamIds 需要删除的运维团队信息管理主键
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int deleteOmTeamInfoByTeamIds(String[] teamIds)
{
for(String teamId:teamIds){
// 查询租户id
String tenantId = omTeamInfoMapper.selectOmTeamInfoByTeamId(teamId).getTenantId();
// 删除相关角色
sysRoleService.deleteRoleBytenantId(tenantId);
// 删除相关部门
sysDeptService.deleteDeptByTenantId(tenantId);
// 删除相关岗位
syspostService.deletePostByTenantId(tenantId);
// 查询下属用户并删除
SysUser sysUser = new SysUser();
sysUser.setTenantId(tenantId);
List<SysUser> userList=sysUserService.selectUserList(sysUser);
Long[] userIds = userList.stream().map(user -> user.getUserId()).toArray(Long[]::new);
sysUserService.deleteUserByIds(userIds);
}
return omTeamInfoMapper.deleteOmTeamInfoByTeamIds(teamIds);
}
/**
* 删除运维团队信息管理信息
*
* @param teamId 运维团队信息管理主键
* @return 结果
*/
@Override
public int deleteOmTeamInfoByTeamId(String teamId)
{
return omTeamInfoMapper.deleteOmTeamInfoByTeamId(teamId);
}
/**
* 查询运维团队信息管理
*
* @param tenantId 租户id
* @return 运维团队信息管理
*/
@Override
public OmTeamInfo selectOmTeamInfoByTenantId(String tenantId){
return omTeamInfoMapper.selectOmTeamInfoByTenantId(tenantId);
}
}

View File

@ -0,0 +1,140 @@
<?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.inspur.om.mapper.OmTeamInfoMapper">
<resultMap type="com.inspur.om.domain.OmTeamInfo" id="OmTeamInfoResult">
<result property="teamId" column="team_id"/>
<result property="teamName" column="team_name"/>
<result property="contacts" column="contacts"/>
<result property="telephone" column="telephone"/>
<result property="mail" column="mail"/>
<result property="businessType" column="business_type"/>
<result property="field" column="field"/>
<result property="workScope" column="work_scope"/>
<result property="status" column="status"/>
<result property="delFlag" column="del_flag"/>
<result property="tenantId" column="tenant_id"/>
<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="selectOmTeamInfoVo">
select team_id,
team_name,
contacts,
telephone,
mail,
business_type,
field,
work_scope,
status,
del_flag,
tenant_id,
create_by,
create_time,
update_by,
update_time
from om_team_info
</sql>
<select id="selectOmTeamInfoList" parameterType="com.inspur.om.domain.OmTeamInfo" resultMap="OmTeamInfoResult">
<include refid="selectOmTeamInfoVo"/>
where
del_flag = '0'
<if test="teamName != null and teamName != ''">and team_name like concat('%', #{teamName}, '%')</if>
<if test="contacts != null and contacts != ''">and contacts = #{contacts}</if>
<if test="telephone != null and telephone != ''">and telephone = #{telephone}</if>
<if test="mail != null and mail != ''">and mail = #{mail}</if>
<if test="businessType != null and businessType != ''">and business_type = #{businessType}</if>
<if test="field != null and field != ''">and field = #{field}</if>
<if test="workScope != null and workScope != ''">and work_scope = #{workScope}</if>
<if test="status != null and status != ''">and status = #{status}</if>
<if test="tenantId != null and tenantId != ''">and tenant_id = #{tenantId}</if>
</select>
<select id="selectOmTeamInfoByTeamId" parameterType="String" resultMap="OmTeamInfoResult">
<include refid="selectOmTeamInfoVo"/>
where team_id = #{teamId}
</select>
<insert id="insertOmTeamInfo" parameterType="com.inspur.om.domain.OmTeamInfo">
insert into om_team_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="teamId != null">team_id,</if>
<if test="teamName != null and teamName != ''">team_name,</if>
<if test="contacts != null">contacts,</if>
<if test="telephone != null">telephone,</if>
<if test="mail != null">mail,</if>
<if test="businessType != null">business_type,</if>
<if test="field != null">field,</if>
<if test="workScope != null">work_scope,</if>
<if test="status != null">status,</if>
<if test="delFlag != null">del_flag,</if>
<if test="tenantId != null">tenant_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="teamId != null">#{teamId},</if>
<if test="teamName != null and teamName != ''">#{teamName},</if>
<if test="contacts != null">#{contacts},</if>
<if test="telephone != null">#{telephone},</if>
<if test="mail != null">#{mail},</if>
<if test="businessType != null">#{businessType},</if>
<if test="field != null">#{field},</if>
<if test="workScope != null">#{workScope},</if>
<if test="status != null">#{status},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="tenantId != null">#{tenantId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateOmTeamInfo" parameterType="com.inspur.om.domain.OmTeamInfo">
update om_team_info
<trim prefix="SET" suffixOverrides=",">
<if test="teamName != null and teamName != ''">team_name = #{teamName},</if>
<if test="contacts != null">contacts = #{contacts},</if>
<if test="telephone != null">telephone = #{telephone},</if>
<if test="mail != null">mail = #{mail},</if>
<if test="businessType != null">business_type = #{businessType},</if>
<if test="field != null">field = #{field},</if>
<if test="workScope != null">work_scope = #{workScope},</if>
<if test="status != null">status = #{status},</if>
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where team_id = #{teamId}
</update>
<update id="deleteOmTeamInfoByTeamId" parameterType="String">
update om_team_info set del_flag = '2'
where team_id = #{teamId}
</update>
<update id="deleteOmTeamInfoByTeamIds" parameterType="String">
update om_team_info set del_flag = '2' where team_id in
<foreach item="teamId" collection="array" open="(" separator="," close=")">
#{teamId}
</foreach>
</update>
<select id="selectOmTeamInfoByTenantId" parameterType="String" resultMap="OmTeamInfoResult">
<include refid="selectOmTeamInfoVo"/>
where tenant_id = #{tenantId}
</select>
<select id="selectNextTenantId" resultType="string">
select CAST(max(tenant_id)+1 AS SIGNED) from om_team_info
</select>
</mapper>

View File

@ -115,4 +115,12 @@ public interface SysDeptMapper
* @return 结果
*/
public int deleteDeptById(Long deptId);
/**
* 删除部门管理信息
*
* @param tenantId 租户i的
* @return 结果
*/
public int deleteDeptByTenantId(String tenantId);
}

View File

@ -100,4 +100,12 @@ public interface SysPostMapper
* @return 结果
*/
public SysPost checkPostCodeUnique(@Param("tenantId") String tenantId, @Param("postCode") String postCode);
/**
* 删除岗位信息
*
* @param tenantId 租户id
* @return 结果
*/
public int deletePostByTenantId(String tenantId);
}

View File

@ -108,4 +108,12 @@ public interface SysRoleMapper
* @return 结果
*/
public int deleteRoleByIds(Long[] roleIds);
/**
* 通过租户ID删除角色
*
* @param tenantId 租户id
* @return 结果
*/
public int deleteRoleBytenantId(String tenantId);
}

View File

@ -121,4 +121,12 @@ public interface ISysDeptService
* @return 结果
*/
public int deleteDeptById(Long deptId);
/**
* 删除部门管理信息
*
* @param tenantId 租户i的
* @return 结果
*/
public int deleteDeptByTenantId(String tenantId);
}

View File

@ -5,14 +5,14 @@ import com.inspur.system.domain.SysPost;
/**
* 岗位信息 服务层
*
*
* @author inspur
*/
public interface ISysPostService
{
/**
* 查询岗位信息集合
*
*
* @param post 岗位信息
* @return 岗位列表
*/
@ -20,14 +20,14 @@ public interface ISysPostService
/**
* 查询所有岗位
*
*
* @return 岗位列表
*/
public List<SysPost> selectPostAll();
/**
* 通过岗位ID查询岗位信息
*
*
* @param postId 岗位ID
* @return 角色对象信息
*/
@ -35,7 +35,7 @@ public interface ISysPostService
/**
* 根据用户ID获取岗位选择框列表
*
*
* @param userId 用户ID
* @return 选中岗位ID列表
*/
@ -43,7 +43,7 @@ public interface ISysPostService
/**
* 校验岗位名称
*
*
* @param post 岗位信息
* @return 结果
*/
@ -51,7 +51,7 @@ public interface ISysPostService
/**
* 校验岗位编码
*
*
* @param post 岗位信息
* @return 结果
*/
@ -59,7 +59,7 @@ public interface ISysPostService
/**
* 通过岗位ID查询岗位使用数量
*
*
* @param postId 岗位ID
* @return 结果
*/
@ -67,7 +67,7 @@ public interface ISysPostService
/**
* 删除岗位信息
*
*
* @param postId 岗位ID
* @return 结果
*/
@ -75,7 +75,7 @@ public interface ISysPostService
/**
* 批量删除岗位信息
*
*
* @param postIds 需要删除的岗位ID
* @return 结果
*/
@ -83,7 +83,7 @@ public interface ISysPostService
/**
* 新增保存岗位信息
*
*
* @param post 岗位信息
* @return 结果
*/
@ -91,9 +91,17 @@ public interface ISysPostService
/**
* 修改保存岗位信息
*
*
* @param post 岗位信息
* @return 结果
*/
public int updatePost(SysPost post);
/**
* 删除岗位信息
*
* @param tenantId 租户id
* @return 结果
*/
public int deletePostByTenantId(String tenantId);
}

View File

@ -7,14 +7,14 @@ import com.inspur.system.domain.SysUserRole;
/**
* 角色业务层
*
*
* @author inspur
*/
public interface ISysRoleService
{
/**
* 根据条件分页查询角色数据
*
*
* @param role 角色信息
* @return 角色数据集合信息
*/
@ -22,7 +22,7 @@ public interface ISysRoleService
/**
* 根据用户ID查询角色列表
*
*
* @param userId 用户ID
* @return 角色列表
*/
@ -30,7 +30,7 @@ public interface ISysRoleService
/**
* 根据用户ID查询角色权限
*
*
* @param userId 用户ID
* @return 权限列表
*/
@ -38,14 +38,14 @@ public interface ISysRoleService
/**
* 查询所有角色
*
*
* @return 角色列表
*/
public List<SysRole> selectRoleAll();
/**
* 根据用户ID获取角色选择框列表
*
*
* @param userId 用户ID
* @return 选中角色ID列表
*/
@ -53,7 +53,7 @@ public interface ISysRoleService
/**
* 通过角色ID查询角色
*
*
* @param roleId 角色ID
* @return 角色对象信息
*/
@ -61,7 +61,7 @@ public interface ISysRoleService
/**
* 校验角色名称是否唯一
*
*
* @param role 角色信息
* @return 结果
*/
@ -69,7 +69,7 @@ public interface ISysRoleService
/**
* 校验角色权限是否唯一
*
*
* @param role 角色信息
* @return 结果
*/
@ -77,21 +77,21 @@ public interface ISysRoleService
/**
* 校验角色是否允许操作
*
*
* @param role 角色信息
*/
public void checkRoleAllowed(SysRole role);
/**
* 校验角色是否有数据权限
*
*
* @param roleId 角色id
*/
public void checkRoleDataScope(Long roleId);
/**
* 通过角色ID查询角色使用数量
*
*
* @param roleId 角色ID
* @return 结果
*/
@ -99,7 +99,7 @@ public interface ISysRoleService
/**
* 新增保存角色信息
*
*
* @param role 角色信息
* @return 结果
*/
@ -107,7 +107,7 @@ public interface ISysRoleService
/**
* 修改保存角色信息
*
*
* @param role 角色信息
* @return 结果
*/
@ -115,7 +115,7 @@ public interface ISysRoleService
/**
* 修改角色状态
*
*
* @param role 角色信息
* @return 结果
*/
@ -123,7 +123,7 @@ public interface ISysRoleService
/**
* 修改数据权限信息
*
*
* @param role 角色信息
* @return 结果
*/
@ -131,7 +131,7 @@ public interface ISysRoleService
/**
* 通过角色ID删除角色
*
*
* @param roleId 角色ID
* @return 结果
*/
@ -139,7 +139,7 @@ public interface ISysRoleService
/**
* 批量删除角色信息
*
*
* @param roleIds 需要删除的角色ID
* @return 结果
*/
@ -147,7 +147,7 @@ public interface ISysRoleService
/**
* 取消授权用户角色
*
*
* @param userRole 用户和角色关联信息
* @return 结果
*/
@ -155,7 +155,7 @@ public interface ISysRoleService
/**
* 批量取消授权用户角色
*
*
* @param roleId 角色ID
* @param userIds 需要取消授权的用户数据ID
* @return 结果
@ -164,10 +164,18 @@ public interface ISysRoleService
/**
* 批量选择授权用户角色
*
*
* @param roleId 角色ID
* @param userIds 需要删除的用户数据ID
* @return 结果
*/
public int insertAuthUsers(Long roleId, Long[] userIds);
/**
* 通过租户ID删除角色
*
* @param tenantId 租户id
* @return 结果
*/
public int deleteRoleBytenantId(String tenantId);
}

View File

@ -45,7 +45,9 @@ public class SysDeptServiceImpl implements ISysDeptService
@DataScope(deptAlias = "d")
public List<SysDept> selectDeptList(SysDept dept)
{
dept.setTenantId(SecurityUtils.getTenantId());
if(StringUtils.isNull(dept.getTenantId())){
dept.setTenantId(SecurityUtils.getTenantId());
}
return deptMapper.selectDeptList(dept);
}
@ -219,7 +221,9 @@ public class SysDeptServiceImpl implements ISysDeptService
throw new ServiceException("部门停用,不允许新增");
}
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
dept.setTenantId(SecurityUtils.getTenantId());
if(StringUtils.isNull(dept.getTenantId())){
dept.setTenantId(SecurityUtils.getTenantId());
}
return deptMapper.insertDept(dept);
}
@ -295,6 +299,17 @@ public class SysDeptServiceImpl implements ISysDeptService
return deptMapper.deleteDeptById(deptId);
}
/**
* 删除部门管理信息
*
* @param tenantId 租户i的
* @return 结果
*/
@Override
public int deleteDeptByTenantId(String tenantId){
return deptMapper.deleteDeptByTenantId(tenantId);
}
/**
* 递归列表
*/

View File

@ -36,7 +36,9 @@ public class SysPostServiceImpl implements ISysPostService
@Override
public List<SysPost> selectPostList(SysPost post)
{
post.setTenantId(SecurityUtils.getTenantId());
if(StringUtils.isNull(post.getTenantId())){
post.setTenantId(SecurityUtils.getTenantId());
}
return postMapper.selectPostList(post);
}
@ -85,7 +87,7 @@ public class SysPostServiceImpl implements ISysPostService
public boolean checkPostNameUnique(SysPost post)
{
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
SysPost info = postMapper.checkPostNameUnique(SecurityUtils.getTenantId(),post.getPostName());
SysPost info = postMapper.checkPostNameUnique(StringUtils.isNull(post.getTenantId()) ? SecurityUtils.getTenantId() : post.getTenantId(),post.getPostName());
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
{
return UserConstants.NOT_UNIQUE;
@ -103,7 +105,7 @@ public class SysPostServiceImpl implements ISysPostService
public boolean checkPostCodeUnique(SysPost post)
{
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
SysPost info = postMapper.checkPostCodeUnique(SecurityUtils.getTenantId(),post.getPostCode());
SysPost info = postMapper.checkPostCodeUnique(StringUtils.isNull(post.getTenantId()) ? SecurityUtils.getTenantId() : post.getTenantId(),post.getPostCode());
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
{
return UserConstants.NOT_UNIQUE;
@ -164,7 +166,9 @@ public class SysPostServiceImpl implements ISysPostService
@Override
public int insertPost(SysPost post)
{
post.setTenantId(SecurityUtils.getTenantId());
if(StringUtils.isNull(post.getTenantId())){
post.setTenantId(SecurityUtils.getTenantId());
}
return postMapper.insertPost(post);
}
@ -179,4 +183,16 @@ public class SysPostServiceImpl implements ISysPostService
{
return postMapper.updatePost(post);
}
/**
* 删除岗位信息
*
* @param tenantId 租户id
* @return 结果
*/
@Override
public int deletePostByTenantId(String tenantId){
return postMapper.deletePostByTenantId(tenantId);
}
}

View File

@ -5,6 +5,7 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -31,8 +32,7 @@ import com.inspur.system.service.ISysRoleService;
* @author inspur
*/
@Service
public class SysRoleServiceImpl implements ISysRoleService
{
public class SysRoleServiceImpl implements ISysRoleService {
@Autowired
private SysRoleMapper roleMapper;
@ -53,9 +53,10 @@ public class SysRoleServiceImpl implements ISysRoleService
*/
@Override
@DataScope(deptAlias = "d")
public List<SysRole> selectRoleList(SysRole role)
{
role.setTenantId(SecurityUtils.getTenantId());
public List<SysRole> selectRoleList(SysRole role) {
if(StringUtils.isNull(role.getTenantId())){
role.setTenantId(SecurityUtils.getTenantId());
}
return roleMapper.selectRoleList(role);
}
@ -66,16 +67,12 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return 角色列表
*/
@Override
public List<SysRole> selectRolesByUserId(Long userId)
{
public List<SysRole> selectRolesByUserId(Long userId) {
List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId);
List<SysRole> roles = selectRoleAll();
for (SysRole role : roles)
{
for (SysRole userRole : userRoles)
{
if (role.getRoleId().longValue() == userRole.getRoleId().longValue())
{
for (SysRole role : roles) {
for (SysRole userRole : userRoles) {
if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) {
role.setFlag(true);
break;
}
@ -91,14 +88,11 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return 权限列表
*/
@Override
public Set<String> selectRolePermissionByUserId(Long userId)
{
public Set<String> selectRolePermissionByUserId(Long userId) {
List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId);
Set<String> permsSet = new HashSet<>();
for (SysRole perm : perms)
{
if (StringUtils.isNotNull(perm))
{
for (SysRole perm : perms) {
if (StringUtils.isNotNull(perm)) {
permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
}
}
@ -111,8 +105,7 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return 角色列表
*/
@Override
public List<SysRole> selectRoleAll()
{
public List<SysRole> selectRoleAll() {
return SpringUtils.getAopProxy(this).selectRoleList(new SysRole());
}
@ -123,8 +116,7 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return 选中角色ID列表
*/
@Override
public List<Long> selectRoleListByUserId(Long userId)
{
public List<Long> selectRoleListByUserId(Long userId) {
return roleMapper.selectRoleListByUserId(userId);
}
@ -135,8 +127,7 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return 角色对象信息
*/
@Override
public SysRole selectRoleById(Long roleId)
{
public SysRole selectRoleById(Long roleId) {
return roleMapper.selectRoleById(roleId);
}
@ -147,12 +138,10 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return 结果
*/
@Override
public boolean checkRoleNameUnique(SysRole role)
{
public boolean checkRoleNameUnique(SysRole role) {
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
SysRole info = roleMapper.checkRoleNameUnique(SecurityUtils.getTenantId(),role.getRoleName());
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
{
SysRole info = roleMapper.checkRoleNameUnique(StringUtils.isNull(role.getTenantId()) ? SecurityUtils.getTenantId() : role.getTenantId(), role.getRoleName());
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
@ -165,12 +154,10 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return 结果
*/
@Override
public boolean checkRoleKeyUnique(SysRole role)
{
public boolean checkRoleKeyUnique(SysRole role) {
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
SysRole info = roleMapper.checkRoleKeyUnique(SecurityUtils.getTenantId(),role.getRoleKey());
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
{
SysRole info = roleMapper.checkRoleKeyUnique(StringUtils.isNull(role.getTenantId()) ? SecurityUtils.getTenantId() : role.getTenantId(), role.getRoleKey());
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
@ -182,10 +169,8 @@ public class SysRoleServiceImpl implements ISysRoleService
* @param role 角色信息
*/
@Override
public void checkRoleAllowed(SysRole role)
{
if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin())
{
public void checkRoleAllowed(SysRole role) {
if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) {
throw new ServiceException("不允许操作超级管理员角色");
}
}
@ -196,15 +181,12 @@ public class SysRoleServiceImpl implements ISysRoleService
* @param roleId 角色id
*/
@Override
public void checkRoleDataScope(Long roleId)
{
if (!SysUser.isAdmin(SecurityUtils.getUserId()))
{
public void checkRoleDataScope(Long roleId) {
if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
SysRole role = new SysRole();
role.setRoleId(roleId);
List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role);
if (StringUtils.isEmpty(roles))
{
if (StringUtils.isEmpty(roles)) {
throw new ServiceException("没有权限访问角色数据!");
}
}
@ -217,8 +199,7 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return 结果
*/
@Override
public int countUserRoleByRoleId(Long roleId)
{
public int countUserRoleByRoleId(Long roleId) {
return userRoleMapper.countUserRoleByRoleId(roleId);
}
@ -230,10 +211,11 @@ public class SysRoleServiceImpl implements ISysRoleService
*/
@Override
@Transactional
public int insertRole(SysRole role)
{
public int insertRole(SysRole role) {
// 新增角色信息
role.setTenantId(SecurityUtils.getTenantId());
if(StringUtils.isNull(role.getTenantId())){
role.setTenantId(SecurityUtils.getTenantId());
}
roleMapper.insertRole(role);
return insertRoleMenu(role);
}
@ -246,8 +228,7 @@ public class SysRoleServiceImpl implements ISysRoleService
*/
@Override
@Transactional
public int updateRole(SysRole role)
{
public int updateRole(SysRole role) {
// 修改角色信息
roleMapper.updateRole(role);
// 删除角色与菜单关联
@ -262,8 +243,7 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return 结果
*/
@Override
public int updateRoleStatus(SysRole role)
{
public int updateRoleStatus(SysRole role) {
return roleMapper.updateRole(role);
}
@ -275,8 +255,7 @@ public class SysRoleServiceImpl implements ISysRoleService
*/
@Override
@Transactional
public int authDataScope(SysRole role)
{
public int authDataScope(SysRole role) {
// 修改角色信息
roleMapper.updateRole(role);
// 删除角色与部门关联
@ -290,20 +269,17 @@ public class SysRoleServiceImpl implements ISysRoleService
*
* @param role 角色对象
*/
public int insertRoleMenu(SysRole role)
{
public int insertRoleMenu(SysRole role) {
int rows = 1;
// 新增用户与角色管理
List<SysRoleMenu> list = new ArrayList<SysRoleMenu>();
for (Long menuId : role.getMenuIds())
{
for (Long menuId : role.getMenuIds()) {
SysRoleMenu rm = new SysRoleMenu();
rm.setRoleId(role.getRoleId());
rm.setMenuId(menuId);
list.add(rm);
}
if (list.size() > 0)
{
if (list.size() > 0) {
rows = roleMenuMapper.batchRoleMenu(list);
}
return rows;
@ -314,20 +290,17 @@ public class SysRoleServiceImpl implements ISysRoleService
*
* @param role 角色对象
*/
public int insertRoleDept(SysRole role)
{
public int insertRoleDept(SysRole role) {
int rows = 1;
// 新增角色与部门数据权限管理
List<SysRoleDept> list = new ArrayList<SysRoleDept>();
for (Long deptId : role.getDeptIds())
{
for (Long deptId : role.getDeptIds()) {
SysRoleDept rd = new SysRoleDept();
rd.setRoleId(role.getRoleId());
rd.setDeptId(deptId);
list.add(rd);
}
if (list.size() > 0)
{
if (list.size() > 0) {
rows = roleDeptMapper.batchRoleDept(list);
}
return rows;
@ -341,8 +314,7 @@ public class SysRoleServiceImpl implements ISysRoleService
*/
@Override
@Transactional
public int deleteRoleById(Long roleId)
{
public int deleteRoleById(Long roleId) {
// 删除角色与菜单关联
roleMenuMapper.deleteRoleMenuByRoleId(roleId);
// 删除角色与部门关联
@ -358,15 +330,12 @@ public class SysRoleServiceImpl implements ISysRoleService
*/
@Override
@Transactional
public int deleteRoleByIds(Long[] roleIds)
{
for (Long roleId : roleIds)
{
public int deleteRoleByIds(Long[] roleIds) {
for (Long roleId : roleIds) {
checkRoleAllowed(new SysRole(roleId));
checkRoleDataScope(roleId);
SysRole role = selectRoleById(roleId);
if (countUserRoleByRoleId(roleId) > 0)
{
if (countUserRoleByRoleId(roleId) > 0) {
throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
}
}
@ -384,38 +353,34 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return 结果
*/
@Override
public int deleteAuthUser(SysUserRole userRole)
{
public int deleteAuthUser(SysUserRole userRole) {
return userRoleMapper.deleteUserRoleInfo(userRole);
}
/**
* 批量取消授权用户角色
*
* @param roleId 角色ID
* @param roleId 角色ID
* @param userIds 需要取消授权的用户数据ID
* @return 结果
*/
@Override
public int deleteAuthUsers(Long roleId, Long[] userIds)
{
public int deleteAuthUsers(Long roleId, Long[] userIds) {
return userRoleMapper.deleteUserRoleInfos(roleId, userIds);
}
/**
* 批量选择授权用户角色
*
* @param roleId 角色ID
* @param roleId 角色ID
* @param userIds 需要授权的用户数据ID
* @return 结果
*/
@Override
public int insertAuthUsers(Long roleId, Long[] userIds)
{
public int insertAuthUsers(Long roleId, Long[] userIds) {
// 新增用户与角色管理
List<SysUserRole> list = new ArrayList<SysUserRole>();
for (Long userId : userIds)
{
for (Long userId : userIds) {
SysUserRole ur = new SysUserRole();
ur.setUserId(userId);
ur.setRoleId(roleId);
@ -423,4 +388,15 @@ public class SysRoleServiceImpl implements ISysRoleService
}
return userRoleMapper.batchUserRole(list);
}
/**
* 通过租户ID删除角色
*
* @param tenantId 租户id
* @return 结果
*/
@Override
public int deleteRoleBytenantId(String tenantId) {
return roleMapper.deleteRoleBytenantId(tenantId);
}
}

View File

@ -71,7 +71,9 @@ public class SysUserServiceImpl implements ISysUserService
@DataScope(deptAlias = "d", userAlias = "u")
public List<SysUser> selectUserList(SysUser user)
{
user.setTenantId(SecurityUtils.getTenantId());
if(StringUtils.isNull(user.getTenantId())){
user.setTenantId(SecurityUtils.getTenantId());
}
return userMapper.selectUserList(user);
}
@ -85,7 +87,9 @@ public class SysUserServiceImpl implements ISysUserService
@DataScope(deptAlias = "d", userAlias = "u")
public List<SysUser> selectAllocatedList(SysUser user)
{
user.setTenantId(SecurityUtils.getTenantId());
if(StringUtils.isNull(user.getTenantId())){
user.setTenantId(SecurityUtils.getTenantId());
}
return userMapper.selectAllocatedList(user);
}
@ -99,7 +103,9 @@ public class SysUserServiceImpl implements ISysUserService
@DataScope(deptAlias = "d", userAlias = "u")
public List<SysUser> selectUnallocatedList(SysUser user)
{
user.setTenantId(SecurityUtils.getTenantId());
if(StringUtils.isNull(user.getTenantId())){
user.setTenantId(SecurityUtils.getTenantId());
}
return userMapper.selectUnallocatedList(user);
}
@ -261,7 +267,9 @@ public class SysUserServiceImpl implements ISysUserService
public int insertUser(SysUser user)
{
// 新增用户信息
user.setTenantId(SecurityUtils.getTenantId());
if(StringUtils.isNull(user.getTenantId())){
user.setTenantId(SecurityUtils.getTenantId());
}
int rows = userMapper.insertUser(user);
// 新增用户岗位关联
insertUserPost(user);
@ -279,7 +287,9 @@ public class SysUserServiceImpl implements ISysUserService
@Override
public boolean registerUser(SysUser user)
{
user.setTenantId(SecurityUtils.getTenantId());
if(StringUtils.isNull(user.getTenantId())){
user.setTenantId(SecurityUtils.getTenantId());
}
return userMapper.insertUser(user) > 0;
}

View File

@ -91,7 +91,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="SysDept">
<insert id="insertDept" parameterType="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>
@ -161,5 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteDeptById" parameterType="Long">
update sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete>
<delete id="deleteDeptByTenantId" parameterType="String">
update sys_dept set del_flag = '2' where tenant_id = #{tenantId}
</delete>
</mapper>

View File

@ -135,5 +135,10 @@
#{postId}
</foreach>
</delete>
<delete id="deletePostByTenantId" parameterType="String">
delete
from sys_post
where tenant_id = #{tenantId}
</delete>
</mapper>

View File

@ -63,7 +63,7 @@
and date_format(r.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<if test="tenantId != null and tenantId != ''">
AND tenant_id = #{tenantId}
AND r.tenant_id = #{tenantId}
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
@ -166,5 +166,9 @@
#{roleId}
</foreach>
</delete>
<delete id="deleteRoleBytenantId" parameterType="String">
update sys_role
set del_flag = '2'
where tenant_id = #{tenantId}
</delete>
</mapper>

View File

@ -10,7 +10,7 @@
<name>inspur</name>
<url>http://www.inspur.vip</url>
<description>浪潮管理系统</description>
<description>装备运维知识服务平台</description>
<properties>
<inspur.version>3.8.7</inspur.version>
@ -162,6 +162,13 @@
<version>${inspur.version}</version>
</dependency>
<!-- 运维团队管理-->
<dependency>
<groupId>com.inspur</groupId>
<artifactId>inspur-om</artifactId>
<version>${inspur.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
@ -172,6 +179,7 @@
<module>inspur-quartz</module>
<module>inspur-generator</module>
<module>inspur-common</module>
<module>inspur-om</module>
</modules>
<packaging>pom</packaging>

View File

@ -1,10 +1,10 @@
# 页面标题
VUE_APP_TITLE = 浪潮管理系统
VUE_APP_TITLE = 装备运维知识服务平台
# 开发环境配置
ENV = 'development'
# 浪潮管理系统/开发环境
# 装备运维知识服务平台/开发环境
VUE_APP_BASE_API = '/dev-api'
# 路由懒加载

View File

@ -1,8 +1,8 @@
# 页面标题
VUE_APP_TITLE = 浪潮管理系统
VUE_APP_TITLE = 装备运维知识服务平台
# 生产环境配置
ENV = 'production'
# 浪潮管理系统/生产环境
# 装备运维知识服务平台/生产环境
VUE_APP_BASE_API = '/prod-api'

View File

@ -1,10 +1,10 @@
# 页面标题
VUE_APP_TITLE = 浪潮管理系统
VUE_APP_TITLE = 装备运维知识服务平台
NODE_ENV = production
# 测试环境配置
ENV = 'staging'
# 浪潮管理系统/测试环境
# 装备运维知识服务平台/测试环境
VUE_APP_BASE_API = '/stage-api'

View File

@ -1,8 +1,8 @@
{
"name": "inspur",
"version": "3.8.7",
"description": "浪潮管理系统",
"author": "浪潮",
"description": "装备运维知识服务平台",
"author": "inspur",
"license": "MIT",
"scripts": {
"dev": "vue-cli-service serve",

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询运维团队信息管理列表
export function listTeamInfo(query) {
return request({
url: '/om/teamInfo/list',
method: 'get',
params: query
})
}
// 查询运维团队信息管理详细
export function getTeamInfo(teamId) {
return request({
url: '/om/teamInfo/' + teamId,
method: 'get'
})
}
// 新增运维团队信息管理
export function addTeamInfo(data) {
return request({
url: '/om/teamInfo',
method: 'post',
data: data
})
}
// 修改运维团队信息管理
export function updateTeamInfo(data) {
return request({
url: '/om/teamInfo',
method: 'put',
data: data
})
}
// 删除运维团队信息管理
export function delTeamInfo(teamId) {
return request({
url: '/om/teamInfo/' + teamId,
method: 'delete'
})
}

View File

@ -24,29 +24,6 @@
id="header-search"
class="right-menu-item"
/>
<el-tooltip
content="源码地址"
effect="dark"
placement="bottom"
>
<ruo-yi-git
id="inspur-git"
class="right-menu-item hover-effect"
/>
</el-tooltip>
<el-tooltip
content="文档地址"
effect="dark"
placement="bottom"
>
<ruo-yi-doc
id="inspur-doc"
class="right-menu-item hover-effect"
/>
</el-tooltip>
<screenfull
id="screenfull"
class="right-menu-item hover-effect"

View File

@ -1,6 +1,6 @@
import Cookies from "js-cookie";
const TokenKey = "Inspur-Multi-Template-Token";
const TokenKey = "Eomksp-Token";
export function getToken() {
return Cookies.get(TokenKey);

View File

@ -6,7 +6,21 @@
:rules="loginRules"
class="login-form"
>
<h3 class="title">浪潮后台管理系统</h3>
<h3 class="title">装备运维知识服务平台</h3>
<el-form-item prop="tenantId">
<el-input
v-model="loginForm.tenantId"
type="text"
auto-complete="off"
placeholder="运维团队"
>
<svg-icon
slot="prefix"
icon-class="user"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"

View File

@ -0,0 +1,632 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item
label="团队名称"
prop="teamName"
>
<el-input
v-model="queryParams.teamName"
placeholder="请输入团队名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="联系人"
prop="contacts"
>
<el-input
v-model="queryParams.contacts"
placeholder="请输入联系人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="联系电话"
prop="telephone"
>
<el-input
v-model="queryParams.telephone"
placeholder="请输入联系电话"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="邮箱"
prop="mail"
>
<el-input
v-model="queryParams.mail"
placeholder="请输入邮箱"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="业务类型"
prop="businessType"
>
<el-select
v-model="queryParams.businessType"
placeholder="请选择业务类型"
clearable
>
<el-option
v-for="dict in dict.type.om_business_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
label="领域"
prop="field"
>
<el-select
v-model="queryParams.field"
placeholder="请选择领域"
clearable
>
<el-option
v-for="dict in dict.type.om_field"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
label="工作范围"
prop="workScope"
>
<el-select
v-model="queryParams.workScope"
placeholder="请选择工作范围"
clearable
>
<el-option
v-for="dict in dict.type.om_work_scope"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
label="状态"
prop="status"
>
<el-select
v-model="queryParams.status"
placeholder="状态"
clearable
>
<el-option
v-for="dict in dict.type.om_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
label="租户id"
prop="tenantId"
>
<el-input
v-model="queryParams.tenantId"
placeholder="请输入租户id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button>
</el-form-item>
</el-form>
<el-row
:gutter="10"
class="mb8"
>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['om:teamInfo:add']"
>新增</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['om:teamInfo:edit']"
>修改</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['om:teamInfo:remove']"
>删除</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['om:teamInfo:export']"
>导出</el-button>
</el-col> -->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="teamInfoList"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
/>
<el-table-column
label="主键"
align="center"
prop="teamId"
/>
<el-table-column
label="团队名称"
align="center"
prop="teamName"
/>
<el-table-column
label="联系人"
align="center"
prop="contacts"
/>
<el-table-column
label="联系电话"
align="center"
prop="telephone"
/>
<el-table-column
label="邮箱"
align="center"
prop="mail"
/>
<el-table-column
label="业务类型"
align="center"
prop="businessType"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.om_business_type"
:value="scope.row.businessType"
/>
</template>
</el-table-column>
<el-table-column
label="领域"
align="center"
prop="field"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.om_field"
:value="scope.row.field"
/>
</template>
</el-table-column>
<el-table-column
label="工作范围"
align="center"
prop="workScope"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.om_work_scope"
:value="scope.row.workScope"
/>
</template>
</el-table-column>
<el-table-column
label="是否在用 0 停用1 在用"
align="center"
prop="status"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.om_status"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column
label="租户id"
align="center"
prop="tenantId"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['om:teamInfo:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['om:teamInfo:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改运维团队信息管理对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
width="500px"
append-to-body
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="80px"
>
<el-form-item
label="团队名称"
prop="teamName"
>
<el-input
v-model="form.teamName"
placeholder="请输入团队名称"
/>
</el-form-item>
<el-form-item
label="联系人"
prop="contacts"
>
<el-input
v-model="form.contacts"
placeholder="请输入联系人"
/>
</el-form-item>
<el-form-item
label="联系电话"
prop="telephone"
>
<el-input
v-model="form.telephone"
placeholder="请输入联系电话"
/>
</el-form-item>
<el-form-item
label="邮箱"
prop="mail"
>
<el-input
v-model="form.mail"
placeholder="请输入邮箱"
/>
</el-form-item>
<el-form-item
label="业务类型"
prop="businessType"
>
<el-select
v-model="form.businessType"
placeholder="请选择业务类型"
>
<el-option
v-for="dict in dict.type.om_business_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label="领域"
prop="field"
>
<el-select
v-model="form.field"
placeholder="请选择领域"
>
<el-option
v-for="dict in dict.type.om_field"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label="工作范围"
prop="workScope"
>
<el-select
v-model="form.workScope"
placeholder="请选择工作范围"
>
<el-option
v-for="dict in dict.type.om_work_scope"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label="是否在用 0 停用1 在用"
prop="status"
>
<el-select
v-model="form.status"
placeholder="请选择是否在用 0 停用1 在用"
>
<el-option
v-for="dict in dict.type.om_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label="租户id"
prop="tenantId"
>
<el-input
v-model="form.tenantId"
placeholder="请输入租户id"
/>
</el-form-item>
</el-form>
<div
slot="footer"
class="dialog-footer"
>
<el-button
type="primary"
@click="submitForm"
> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listTeamInfo,
getTeamInfo,
delTeamInfo,
addTeamInfo,
updateTeamInfo,
} from "@/api/om/teamInfo";
export default {
name: "TeamInfo",
dicts: ["om_field", "om_work_scope", "om_status", "om_business_type"],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
teamInfoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
teamName: null,
contacts: null,
telephone: null,
mail: null,
businessType: null,
field: null,
workScope: null,
status: null,
tenantId: null,
},
//
form: {},
//
rules: {
teamName: [
{ required: true, message: "团队名称不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询运维团队信息管理列表 */
getList() {
this.loading = true;
listTeamInfo(this.queryParams).then((response) => {
this.teamInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
teamId: null,
teamName: null,
contacts: null,
telephone: null,
mail: null,
businessType: null,
field: null,
workScope: null,
status: null,
tenantId: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.teamId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加运维团队信息管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const teamId = row.teamId || this.ids;
getTeamInfo(teamId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改运维团队信息管理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.teamId != null) {
updateTeamInfo(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addTeamInfo(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const teamIds = row.teamId || this.ids;
this.$modal
.confirm(
'是否确认删除运维团队信息管理编号为"' + teamIds + '"的数据项?'
)
.then(function () {
return delTeamInfo(teamIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"om/teamInfo/export",
{
...this.queryParams,
},
`teamInfo_${new Date().getTime()}.xlsx`
);
},
},
};
</script>

View File

@ -6,7 +6,7 @@
:rules="registerRules"
class="register-form"
>
<h3 class="title">浪潮后台管理系统</h3>
<h3 class="title">装备运维知识服务平台</h3>
<el-form-item prop="username">
<el-input
v-model="registerForm.username"

View File

@ -7,7 +7,7 @@ function resolve(dir) {
const CompressionPlugin = require("compression-webpack-plugin");
const name = process.env.VUE_APP_TITLE || "浪潮管理系统"; // 网页标题
const name = process.env.VUE_APP_TITLE || "装备运维知识服务平台"; // 网页标题
const port = process.env.port || process.env.npm_config_port || 80; // 端口