From 4c2cce39653444c2d1874e980af556421820bff7 Mon Sep 17 00:00:00 2001 From: zhanghan11 Date: Fri, 22 Mar 2024 15:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E5=A4=9A=E7=A7=9F=E6=88=B7?= =?UTF-8?q?=E6=94=B9=E9=80=A0=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inspur-service/inspur-admin/pom.xml | 6 + .../java/com/inspur/InspurApplication.java | 2 +- .../controller/om/OmTeamInfoController.java | 104 +++ .../inspur/web/core/config/SwaggerConfig.java | 2 +- .../src/main/resources/application-druid.yml | 2 +- .../main/resources/i18n/messages.properties | 5 +- .../common/constant/CacheConstants.java | 14 +- .../com/inspur/common/constant/Constants.java | 2 +- .../inspur/common/constant/OmConstants.java | 61 ++ .../inspur/common/constant/UserConstants.java | 9 +- inspur-service/inspur-framework/pom.xml | 6 +- .../web/service/UserDetailsServiceImpl.java | 20 + .../com/inspur/generator/util/GenUtils.java | 2 +- inspur-service/inspur-om/pom.xml | 30 + .../java/com/inspur/om/domain/OmTeamInfo.java | 166 +++++ .../inspur/om/mapper/OmTeamInfoMapper.java | 76 +++ .../inspur/om/service/IOmTeamInfoService.java | 71 ++ .../service/impl/OmTeamInfoServiceImpl.java | 178 +++++ .../resources/mapper/om/OmTeamInfoMapper.xml | 140 ++++ .../inspur/system/mapper/SysDeptMapper.java | 8 + .../inspur/system/mapper/SysPostMapper.java | 8 + .../inspur/system/mapper/SysRoleMapper.java | 8 + .../system/service/ISysDeptService.java | 8 + .../system/service/ISysPostService.java | 32 +- .../system/service/ISysRoleService.java | 50 +- .../service/impl/SysDeptServiceImpl.java | 19 +- .../service/impl/SysPostServiceImpl.java | 24 +- .../service/impl/SysRoleServiceImpl.java | 148 ++-- .../service/impl/SysUserServiceImpl.java | 20 +- .../resources/mapper/system/SysDeptMapper.xml | 6 +- .../resources/mapper/system/SysPostMapper.xml | 5 + .../resources/mapper/system/SysRoleMapper.xml | 8 +- inspur-service/pom.xml | 10 +- inspur-ui/.env.development | 4 +- inspur-ui/.env.production | 4 +- inspur-ui/.env.staging | 4 +- inspur-ui/package.json | 4 +- inspur-ui/src/api/om/teamInfo.js | 44 ++ inspur-ui/src/layout/components/Navbar.vue | 23 - inspur-ui/src/utils/auth.js | 2 +- inspur-ui/src/views/login.vue | 16 +- inspur-ui/src/views/om/teamInfo/index.vue | 632 ++++++++++++++++++ inspur-ui/src/views/register.vue | 2 +- inspur-ui/vue.config.js | 2 +- 44 files changed, 1801 insertions(+), 186 deletions(-) create mode 100644 inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/om/OmTeamInfoController.java create mode 100644 inspur-service/inspur-common/src/main/java/com/inspur/common/constant/OmConstants.java create mode 100644 inspur-service/inspur-om/pom.xml create mode 100644 inspur-service/inspur-om/src/main/java/com/inspur/om/domain/OmTeamInfo.java create mode 100644 inspur-service/inspur-om/src/main/java/com/inspur/om/mapper/OmTeamInfoMapper.java create mode 100644 inspur-service/inspur-om/src/main/java/com/inspur/om/service/IOmTeamInfoService.java create mode 100644 inspur-service/inspur-om/src/main/java/com/inspur/om/service/impl/OmTeamInfoServiceImpl.java create mode 100644 inspur-service/inspur-om/src/main/resources/mapper/om/OmTeamInfoMapper.xml create mode 100644 inspur-ui/src/api/om/teamInfo.js create mode 100644 inspur-ui/src/views/om/teamInfo/index.vue diff --git a/inspur-service/inspur-admin/pom.xml b/inspur-service/inspur-admin/pom.xml index 73ec76d..8bd4b06 100644 --- a/inspur-service/inspur-admin/pom.xml +++ b/inspur-service/inspur-admin/pom.xml @@ -60,6 +60,12 @@ com.inspur inspur-generator + + com.inspur + inspur-om + 3.8.7 + compile + diff --git a/inspur-service/inspur-admin/src/main/java/com/inspur/InspurApplication.java b/inspur-service/inspur-admin/src/main/java/com/inspur/InspurApplication.java index 1e4e428..56811da 100644 --- a/inspur-service/inspur-admin/src/main/java/com/inspur/InspurApplication.java +++ b/inspur-service/inspur-admin/src/main/java/com/inspur/InspurApplication.java @@ -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("装备运维知识服务平台启动成功 "); } } diff --git a/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/om/OmTeamInfoController.java b/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/om/OmTeamInfoController.java new file mode 100644 index 0000000..bddedaa --- /dev/null +++ b/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/om/OmTeamInfoController.java @@ -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 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 list = omTeamInfoService.selectOmTeamInfoList(omTeamInfo); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/inspur-service/inspur-admin/src/main/java/com/inspur/web/core/config/SwaggerConfig.java b/inspur-service/inspur-admin/src/main/java/com/inspur/web/core/config/SwaggerConfig.java index cf2456a..83866d4 100644 --- a/inspur-service/inspur-admin/src/main/java/com/inspur/web/core/config/SwaggerConfig.java +++ b/inspur-service/inspur-admin/src/main/java/com/inspur/web/core/config/SwaggerConfig.java @@ -113,7 +113,7 @@ public class SwaggerConfig // 用ApiInfoBuilder进行定制 return new ApiInfoBuilder() // 设置标题 - .title("标题:浪潮管理系统_接口文档") + .title("标题:装备运维知识服务平台_接口文档") // 描述 .description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...") // 作者信息 diff --git a/inspur-service/inspur-admin/src/main/resources/application-druid.yml b/inspur-service/inspur-admin/src/main/resources/application-druid.yml index 8b732cc..81926a9 100644 --- a/inspur-service/inspur-admin/src/main/resources/application-druid.yml +++ b/inspur-service/inspur-admin/src/main/resources/application-druid.yml @@ -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 # 从库数据源 diff --git a/inspur-service/inspur-admin/src/main/resources/i18n/messages.properties b/inspur-service/inspur-admin/src/main/resources/i18n/messages.properties index 93de005..dccfe65 100644 --- a/inspur-service/inspur-admin/src/main/resources/i18n/messages.properties +++ b/inspur-service/inspur-admin/src/main/resources/i18n/messages.properties @@ -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=登录成功 diff --git a/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/CacheConstants.java b/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/CacheConstants.java index 381ce0d..68fb786 100644 --- a/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/CacheConstants.java +++ b/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/CacheConstants.java @@ -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:"; } diff --git a/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/Constants.java b/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/Constants.java index 3e2428d..654dcc3 100644 --- a/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/Constants.java +++ b/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/Constants.java @@ -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 diff --git a/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/OmConstants.java b/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/OmConstants.java new file mode 100644 index 0000000..d36bdc4 --- /dev/null +++ b/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/OmConstants.java @@ -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; +} diff --git a/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/UserConstants.java b/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/UserConstants.java index ee04a2f..7cb94b7 100644 --- a/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/UserConstants.java +++ b/inspur-service/inspur-common/src/main/java/com/inspur/common/constant/UserConstants.java @@ -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; } diff --git a/inspur-service/inspur-framework/pom.xml b/inspur-service/inspur-framework/pom.xml index 1ec5a83..c87b39b 100644 --- a/inspur-service/inspur-framework/pom.xml +++ b/inspur-service/inspur-framework/pom.xml @@ -58,7 +58,11 @@ com.inspur inspur-system - + + + com.inspur + inspur-om + diff --git a/inspur-service/inspur-framework/src/main/java/com/inspur/framework/web/service/UserDetailsServiceImpl.java b/inspur-service/inspur-framework/src/main/java/com/inspur/framework/web/service/UserDetailsServiceImpl.java index d761256..d85868c 100644 --- a/inspur-service/inspur-framework/src/main/java/com/inspur/framework/web/service/UserDetailsServiceImpl.java +++ b/inspur-service/inspur-framework/src/main/java/com/inspur/framework/web/service/UserDetailsServiceImpl.java @@ -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)) { diff --git a/inspur-service/inspur-generator/src/main/java/com/inspur/generator/util/GenUtils.java b/inspur-service/inspur-generator/src/main/java/com/inspur/generator/util/GenUtils.java index e131198..f50572f 100644 --- a/inspur-service/inspur-generator/src/main/java/com/inspur/generator/util/GenUtils.java +++ b/inspur-service/inspur-generator/src/main/java/com/inspur/generator/util/GenUtils.java @@ -215,7 +215,7 @@ public class GenUtils */ public static String replaceText(String text) { - return RegExUtils.replaceAll(text, "(?:表|浪潮)", ""); + return RegExUtils.replaceAll(text, "(?:表|装备运维知识服务平台)", ""); } /** diff --git a/inspur-service/inspur-om/pom.xml b/inspur-service/inspur-om/pom.xml new file mode 100644 index 0000000..bbd58e1 --- /dev/null +++ b/inspur-service/inspur-om/pom.xml @@ -0,0 +1,30 @@ + + + + inspur + com.inspur + 3.8.7 + + 4.0.0 + + inspur-om + + + 运营团队管理系统模块 + + + + + + com.inspur + inspur-common + + + + com.inspur + inspur-system + + + diff --git a/inspur-service/inspur-om/src/main/java/com/inspur/om/domain/OmTeamInfo.java b/inspur-service/inspur-om/src/main/java/com/inspur/om/domain/OmTeamInfo.java new file mode 100644 index 0000000..ab3b54a --- /dev/null +++ b/inspur-service/inspur-om/src/main/java/com/inspur/om/domain/OmTeamInfo.java @@ -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(); + } +} diff --git a/inspur-service/inspur-om/src/main/java/com/inspur/om/mapper/OmTeamInfoMapper.java b/inspur-service/inspur-om/src/main/java/com/inspur/om/mapper/OmTeamInfoMapper.java new file mode 100644 index 0000000..8cead21 --- /dev/null +++ b/inspur-service/inspur-om/src/main/java/com/inspur/om/mapper/OmTeamInfoMapper.java @@ -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 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(); +} diff --git a/inspur-service/inspur-om/src/main/java/com/inspur/om/service/IOmTeamInfoService.java b/inspur-service/inspur-om/src/main/java/com/inspur/om/service/IOmTeamInfoService.java new file mode 100644 index 0000000..6b0b3ae --- /dev/null +++ b/inspur-service/inspur-om/src/main/java/com/inspur/om/service/IOmTeamInfoService.java @@ -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 selectOmTeamInfoList(OmTeamInfo omTeamInfo); + + /** + * 新增运维团队信息管理 + * + * @param omTeamInfo 运维团队信息管理 + * @return 结果 + */ + public Map 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); +} diff --git a/inspur-service/inspur-om/src/main/java/com/inspur/om/service/impl/OmTeamInfoServiceImpl.java b/inspur-service/inspur-om/src/main/java/com/inspur/om/service/impl/OmTeamInfoServiceImpl.java new file mode 100644 index 0000000..43d6dfa --- /dev/null +++ b/inspur-service/inspur-om/src/main/java/com/inspur/om/service/impl/OmTeamInfoServiceImpl.java @@ -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 selectOmTeamInfoList(OmTeamInfo omTeamInfo) + { + return omTeamInfoMapper.selectOmTeamInfoList(omTeamInfo); + } + + /** + * 新增运维团队信息管理 + * + * @param omTeamInfo 运维团队信息管理 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Map insertOmTeamInfo(OmTeamInfo omTeamInfo) + { + Map 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 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); + } +} diff --git a/inspur-service/inspur-om/src/main/resources/mapper/om/OmTeamInfoMapper.xml b/inspur-service/inspur-om/src/main/resources/mapper/om/OmTeamInfoMapper.xml new file mode 100644 index 0000000..bc6eb8a --- /dev/null +++ b/inspur-service/inspur-om/src/main/resources/mapper/om/OmTeamInfoMapper.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into om_team_info + + 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, + + + #{teamId}, + #{teamName}, + #{contacts}, + #{telephone}, + #{mail}, + #{businessType}, + #{field}, + #{workScope}, + #{status}, + #{delFlag}, + #{tenantId}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update om_team_info + + team_name = #{teamName}, + contacts = #{contacts}, + telephone = #{telephone}, + mail = #{mail}, + business_type = #{businessType}, + field = #{field}, + work_scope = #{workScope}, + status = #{status}, + tenant_id = #{tenantId}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where team_id = #{teamId} + + + + update om_team_info set del_flag = '2' + where team_id = #{teamId} + + + + update om_team_info set del_flag = '2' where team_id in + + #{teamId} + + + + + diff --git a/inspur-service/inspur-system/src/main/java/com/inspur/system/mapper/SysDeptMapper.java b/inspur-service/inspur-system/src/main/java/com/inspur/system/mapper/SysDeptMapper.java index 5888c30..f86bc4a 100644 --- a/inspur-service/inspur-system/src/main/java/com/inspur/system/mapper/SysDeptMapper.java +++ b/inspur-service/inspur-system/src/main/java/com/inspur/system/mapper/SysDeptMapper.java @@ -115,4 +115,12 @@ public interface SysDeptMapper * @return 结果 */ public int deleteDeptById(Long deptId); + + /** + * 删除部门管理信息 + * + * @param tenantId 租户i的 + * @return 结果 + */ + public int deleteDeptByTenantId(String tenantId); } diff --git a/inspur-service/inspur-system/src/main/java/com/inspur/system/mapper/SysPostMapper.java b/inspur-service/inspur-system/src/main/java/com/inspur/system/mapper/SysPostMapper.java index f162835..a44765d 100644 --- a/inspur-service/inspur-system/src/main/java/com/inspur/system/mapper/SysPostMapper.java +++ b/inspur-service/inspur-system/src/main/java/com/inspur/system/mapper/SysPostMapper.java @@ -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); } diff --git a/inspur-service/inspur-system/src/main/java/com/inspur/system/mapper/SysRoleMapper.java b/inspur-service/inspur-system/src/main/java/com/inspur/system/mapper/SysRoleMapper.java index 153fd9d..851188b 100644 --- a/inspur-service/inspur-system/src/main/java/com/inspur/system/mapper/SysRoleMapper.java +++ b/inspur-service/inspur-system/src/main/java/com/inspur/system/mapper/SysRoleMapper.java @@ -108,4 +108,12 @@ public interface SysRoleMapper * @return 结果 */ public int deleteRoleByIds(Long[] roleIds); + + /** + * 通过租户ID删除角色 + * + * @param tenantId 租户id + * @return 结果 + */ + public int deleteRoleBytenantId(String tenantId); } diff --git a/inspur-service/inspur-system/src/main/java/com/inspur/system/service/ISysDeptService.java b/inspur-service/inspur-system/src/main/java/com/inspur/system/service/ISysDeptService.java index 08ff767..7dfbfb3 100644 --- a/inspur-service/inspur-system/src/main/java/com/inspur/system/service/ISysDeptService.java +++ b/inspur-service/inspur-system/src/main/java/com/inspur/system/service/ISysDeptService.java @@ -121,4 +121,12 @@ public interface ISysDeptService * @return 结果 */ public int deleteDeptById(Long deptId); + + /** + * 删除部门管理信息 + * + * @param tenantId 租户i的 + * @return 结果 + */ + public int deleteDeptByTenantId(String tenantId); } diff --git a/inspur-service/inspur-system/src/main/java/com/inspur/system/service/ISysPostService.java b/inspur-service/inspur-system/src/main/java/com/inspur/system/service/ISysPostService.java index 349b062..fa64f65 100644 --- a/inspur-service/inspur-system/src/main/java/com/inspur/system/service/ISysPostService.java +++ b/inspur-service/inspur-system/src/main/java/com/inspur/system/service/ISysPostService.java @@ -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 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); } diff --git a/inspur-service/inspur-system/src/main/java/com/inspur/system/service/ISysRoleService.java b/inspur-service/inspur-system/src/main/java/com/inspur/system/service/ISysRoleService.java index 825ce6a..bf93cb5 100644 --- a/inspur-service/inspur-system/src/main/java/com/inspur/system/service/ISysRoleService.java +++ b/inspur-service/inspur-system/src/main/java/com/inspur/system/service/ISysRoleService.java @@ -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 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); } diff --git a/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysDeptServiceImpl.java b/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysDeptServiceImpl.java index cf741cf..4c47d31 100644 --- a/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysDeptServiceImpl.java +++ b/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysDeptServiceImpl.java @@ -45,7 +45,9 @@ public class SysDeptServiceImpl implements ISysDeptService @DataScope(deptAlias = "d") public List 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); + } + /** * 递归列表 */ diff --git a/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysPostServiceImpl.java b/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysPostServiceImpl.java index 3ceb5b3..1ff03ac 100644 --- a/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysPostServiceImpl.java +++ b/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysPostServiceImpl.java @@ -36,7 +36,9 @@ public class SysPostServiceImpl implements ISysPostService @Override public List 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); + } + } diff --git a/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysRoleServiceImpl.java b/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysRoleServiceImpl.java index 5869e6f..5f51082 100644 --- a/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysRoleServiceImpl.java +++ b/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysRoleServiceImpl.java @@ -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 selectRoleList(SysRole role) - { - role.setTenantId(SecurityUtils.getTenantId()); + public List 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 selectRolesByUserId(Long userId) - { + public List selectRolesByUserId(Long userId) { List userRoles = roleMapper.selectRolePermissionByUserId(userId); List 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 selectRolePermissionByUserId(Long userId) - { + public Set selectRolePermissionByUserId(Long userId) { List perms = roleMapper.selectRolePermissionByUserId(userId); Set 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 selectRoleAll() - { + public List selectRoleAll() { return SpringUtils.getAopProxy(this).selectRoleList(new SysRole()); } @@ -123,8 +116,7 @@ public class SysRoleServiceImpl implements ISysRoleService * @return 选中角色ID列表 */ @Override - public List selectRoleListByUserId(Long userId) - { + public List 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 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 list = new ArrayList(); - 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 list = new ArrayList(); - 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 list = new ArrayList(); - 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); + } } diff --git a/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysUserServiceImpl.java b/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysUserServiceImpl.java index 4260d50..ddf56b2 100644 --- a/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysUserServiceImpl.java +++ b/inspur-service/inspur-system/src/main/java/com/inspur/system/service/impl/SysUserServiceImpl.java @@ -71,7 +71,9 @@ public class SysUserServiceImpl implements ISysUserService @DataScope(deptAlias = "d", userAlias = "u") public List 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 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 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; } diff --git a/inspur-service/inspur-system/src/main/resources/mapper/system/SysDeptMapper.xml b/inspur-service/inspur-system/src/main/resources/mapper/system/SysDeptMapper.xml index 17c364d..423635a 100644 --- a/inspur-service/inspur-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/inspur-service/inspur-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -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 - + insert into sys_dept( dept_id, parent_id, @@ -161,5 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update sys_dept set del_flag = '2' where dept_id = #{deptId} - + + update sys_dept set del_flag = '2' where tenant_id = #{tenantId} + diff --git a/inspur-service/inspur-system/src/main/resources/mapper/system/SysPostMapper.xml b/inspur-service/inspur-system/src/main/resources/mapper/system/SysPostMapper.xml index ce1f907..133f844 100644 --- a/inspur-service/inspur-system/src/main/resources/mapper/system/SysPostMapper.xml +++ b/inspur-service/inspur-system/src/main/resources/mapper/system/SysPostMapper.xml @@ -135,5 +135,10 @@ #{postId} + + delete + from sys_post + where tenant_id = #{tenantId} + diff --git a/inspur-service/inspur-system/src/main/resources/mapper/system/SysRoleMapper.xml b/inspur-service/inspur-system/src/main/resources/mapper/system/SysRoleMapper.xml index 121f3a5..b5c441f 100644 --- a/inspur-service/inspur-system/src/main/resources/mapper/system/SysRoleMapper.xml +++ b/inspur-service/inspur-system/src/main/resources/mapper/system/SysRoleMapper.xml @@ -63,7 +63,7 @@ and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') - AND tenant_id = #{tenantId} + AND r.tenant_id = #{tenantId} ${params.dataScope} @@ -166,5 +166,9 @@ #{roleId} - + + update sys_role + set del_flag = '2' + where tenant_id = #{tenantId} + diff --git a/inspur-service/pom.xml b/inspur-service/pom.xml index fb3057f..3d4836a 100644 --- a/inspur-service/pom.xml +++ b/inspur-service/pom.xml @@ -10,7 +10,7 @@ inspur http://www.inspur.vip - 浪潮管理系统 + 装备运维知识服务平台 3.8.7 @@ -162,6 +162,13 @@ ${inspur.version} + + + com.inspur + inspur-om + ${inspur.version} + + @@ -172,6 +179,7 @@ inspur-quartz inspur-generator inspur-common + inspur-om pom diff --git a/inspur-ui/.env.development b/inspur-ui/.env.development index 9092098..3943553 100644 --- a/inspur-ui/.env.development +++ b/inspur-ui/.env.development @@ -1,10 +1,10 @@ # 页面标题 -VUE_APP_TITLE = 浪潮管理系统 +VUE_APP_TITLE = 装备运维知识服务平台 # 开发环境配置 ENV = 'development' -# 浪潮管理系统/开发环境 +# 装备运维知识服务平台/开发环境 VUE_APP_BASE_API = '/dev-api' # 路由懒加载 diff --git a/inspur-ui/.env.production b/inspur-ui/.env.production index ca05866..0cf7468 100644 --- a/inspur-ui/.env.production +++ b/inspur-ui/.env.production @@ -1,8 +1,8 @@ # 页面标题 -VUE_APP_TITLE = 浪潮管理系统 +VUE_APP_TITLE = 装备运维知识服务平台 # 生产环境配置 ENV = 'production' -# 浪潮管理系统/生产环境 +# 装备运维知识服务平台/生产环境 VUE_APP_BASE_API = '/prod-api' diff --git a/inspur-ui/.env.staging b/inspur-ui/.env.staging index 91f5e61..89af998 100644 --- a/inspur-ui/.env.staging +++ b/inspur-ui/.env.staging @@ -1,10 +1,10 @@ # 页面标题 -VUE_APP_TITLE = 浪潮管理系统 +VUE_APP_TITLE = 装备运维知识服务平台 NODE_ENV = production # 测试环境配置 ENV = 'staging' -# 浪潮管理系统/测试环境 +# 装备运维知识服务平台/测试环境 VUE_APP_BASE_API = '/stage-api' diff --git a/inspur-ui/package.json b/inspur-ui/package.json index 5d9b848..6cf69a4 100644 --- a/inspur-ui/package.json +++ b/inspur-ui/package.json @@ -1,8 +1,8 @@ { "name": "inspur", "version": "3.8.7", - "description": "浪潮管理系统", - "author": "浪潮", + "description": "装备运维知识服务平台", + "author": "inspur", "license": "MIT", "scripts": { "dev": "vue-cli-service serve", diff --git a/inspur-ui/src/api/om/teamInfo.js b/inspur-ui/src/api/om/teamInfo.js new file mode 100644 index 0000000..362d79d --- /dev/null +++ b/inspur-ui/src/api/om/teamInfo.js @@ -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' + }) +} diff --git a/inspur-ui/src/layout/components/Navbar.vue b/inspur-ui/src/layout/components/Navbar.vue index 7c46840..9975d24 100644 --- a/inspur-ui/src/layout/components/Navbar.vue +++ b/inspur-ui/src/layout/components/Navbar.vue @@ -24,29 +24,6 @@ id="header-search" class="right-menu-item" /> - - - - - - - - - -

浪潮后台管理系统

+

装备运维知识服务平台

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + + + 新增 + + + + 删除 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/inspur-ui/src/views/register.vue b/inspur-ui/src/views/register.vue index 5e7b316..01bbeed 100644 --- a/inspur-ui/src/views/register.vue +++ b/inspur-ui/src/views/register.vue @@ -6,7 +6,7 @@ :rules="registerRules" class="register-form" > -

浪潮后台管理系统

+

装备运维知识服务平台