diff --git a/LICENSE b/LICENSE index 1481eda..5533663 100644 --- a/LICENSE +++ b/LICENSE @@ -176,7 +176,7 @@ recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2019 ZhuangQian (smallchill@163.com) + Copyright 2020 BladeX (https://bladex.vip) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 921520f..e90ddd9 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@

- Downloads + Downloads Build Status Build Status - Coverage Status - Downloads + Coverage Status + Downloads Downloads @@ -64,6 +64,7 @@ SpringBlade * Saber-基于Vue:[https://saber.bladex.vip](https://saber.bladex.vip) * Sword-基于React:[https://sword.bladex.vip](https://sword.bladex.vip) * Archer-全能代码生成系统:[https://archer.bladex.vip](https://archer.bladex.vip) +* Caster-数据大屏展示系统:[https://data.avuejs.com](https://data.avuejs.com) ## 技术文档 * [SpringBlade开发手册一览](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade开发手册) diff --git a/blade-auth/pom.xml b/blade-auth/pom.xml index 4807d45..c257084 100644 --- a/blade-auth/pom.xml +++ b/blade-auth/pom.xml @@ -8,7 +8,7 @@ SpringBlade org.springblade - 2.6.2 + 2.7.0 blade-auth diff --git a/blade-auth/src/main/java/org/springblade/auth/controller/AuthController.java b/blade-auth/src/main/java/org/springblade/auth/controller/AuthController.java index 1f1c95d..529264b 100644 --- a/blade-auth/src/main/java/org/springblade/auth/controller/AuthController.java +++ b/blade-auth/src/main/java/org/springblade/auth/controller/AuthController.java @@ -81,6 +81,7 @@ public class AuthController { } @GetMapping("/captcha") + @ApiOperation(value = "获取验证码") public R captcha() { SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5); String verCode = specCaptcha.text().toLowerCase(); diff --git a/blade-common/pom.xml b/blade-common/pom.xml index f09aa45..12cde48 100644 --- a/blade-common/pom.xml +++ b/blade-common/pom.xml @@ -5,7 +5,7 @@ SpringBlade org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java b/blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java index 0be8b2f..698604f 100644 --- a/blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java +++ b/blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java @@ -20,7 +20,7 @@ public interface CommonConstant { /** * 顶级父节点id */ - Integer TOP_PARENT_ID = 0; + Long TOP_PARENT_ID = 0L; /** * 顶级父节点名称 diff --git a/blade-gateway/pom.xml b/blade-gateway/pom.xml index 48544d1..66de537 100644 --- a/blade-gateway/pom.xml +++ b/blade-gateway/pom.xml @@ -5,7 +5,7 @@ SpringBlade org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-gateway/src/main/java/org/springblade/gateway/utils/JwtUtil.java b/blade-gateway/src/main/java/org/springblade/gateway/utils/JwtUtil.java index 289ea6a..79b3ad1 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/utils/JwtUtil.java +++ b/blade-gateway/src/main/java/org/springblade/gateway/utils/JwtUtil.java @@ -46,8 +46,8 @@ public class JwtUtil { String headStr = auth.substring(0, 6).toLowerCase(); if (headStr.compareTo(BEARER) == 0) { auth = auth.substring(7); - return auth; } + return auth; } return null; } diff --git a/blade-ops/blade-admin/pom.xml b/blade-ops/blade-admin/pom.xml index 4eefae8..35236c9 100644 --- a/blade-ops/blade-admin/pom.xml +++ b/blade-ops/blade-admin/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-ops/blade-develop/pom.xml b/blade-ops/blade-develop/pom.xml index efa56c7..e54a94e 100644 --- a/blade-ops/blade-develop/pom.xml +++ b/blade-ops/blade-develop/pom.xml @@ -6,7 +6,7 @@ org.springblade blade-ops - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/CodeController.java b/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/CodeController.java index 371bd2e..2e6908e 100644 --- a/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/CodeController.java +++ b/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/CodeController.java @@ -99,7 +99,7 @@ public class CodeController extends BladeController { @ApiOperationSupport(order = 4) @ApiOperation(value = "删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(codeService.removeByIds(Func.toIntList(ids))); + return R.status(codeService.removeByIds(Func.toLongList(ids))); } /** @@ -108,7 +108,7 @@ public class CodeController extends BladeController { @PostMapping("/copy") @ApiOperationSupport(order = 5) @ApiOperation(value = "复制", notes = "传入id") - public R copy(@ApiParam(value = "主键", required = true) @RequestParam Integer id) { + public R copy(@ApiParam(value = "主键", required = true) @RequestParam Long id) { Code code = codeService.getById(id); code.setId(null); code.setCodeName(code.getCodeName() + "-copy"); @@ -122,7 +122,7 @@ public class CodeController extends BladeController { @ApiOperationSupport(order = 6) @ApiOperation(value = "代码生成", notes = "传入ids") public R genCode(@ApiParam(value = "主键集合", required = true) @RequestParam String ids, @RequestParam(defaultValue = "sword") String system) { - Collection codes = codeService.listByIds(Func.toIntList(ids)); + Collection codes = codeService.listByIds(Func.toLongList(ids)); codes.forEach(code -> { BladeCodeGenerator generator = new BladeCodeGenerator(); // 设置数据源 diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/DatasourceController.java b/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/DatasourceController.java index 11c860b..4ca5a88 100644 --- a/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/DatasourceController.java +++ b/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/DatasourceController.java @@ -107,7 +107,7 @@ public class DatasourceController extends BladeController { @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(datasourceService.deleteLogic(Func.toIntList(ids))); + return R.status(datasourceService.deleteLogic(Func.toLongList(ids))); } /** diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Code.java b/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Code.java index 6363d07..390aee2 100644 --- a/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Code.java +++ b/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Code.java @@ -19,6 +19,8 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -41,14 +43,16 @@ public class Code implements Serializable { * 主键 */ @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; + @TableId(value = "id", type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 数据源主键 */ @ApiModelProperty(value = "数据源主键") - private Integer datasourceId; + @JsonSerialize(using = ToStringSerializer.class) + private Long datasourceId; /** * 模块名称 diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Datasource.java b/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Datasource.java index 1774a4c..c48085c 100644 --- a/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Datasource.java +++ b/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Datasource.java @@ -18,6 +18,8 @@ package org.springblade.develop.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -41,8 +43,9 @@ public class Datasource extends BaseEntity { * 主键 */ @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; + @TableId(value = "id", type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 名称 diff --git a/blade-ops/blade-develop/src/main/resources/templates/controller.java.vm b/blade-ops/blade-develop/src/main/resources/templates/controller.java.vm index f9393d7..58762e2 100644 --- a/blade-ops/blade-develop/src/main/resources/templates/controller.java.vm +++ b/blade-ops/blade-develop/src/main/resources/templates/controller.java.vm @@ -134,7 +134,7 @@ public class $!{table.controllerName} { @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status($!{table.entityPath}Service.deleteLogic(Func.toIntList(ids))); + return R.status($!{table.entityPath}Service.deleteLogic(Func.toLongList(ids))); } #else @@ -146,7 +146,7 @@ public class $!{table.controllerName} { @ApiOperationSupport(order = 7) @ApiOperation(value = "删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status($!{table.entityPath}Service.removeByIds(Func.toIntList(ids))); + return R.status($!{table.entityPath}Service.removeByIds(Func.toLongList(ids))); } #end diff --git a/blade-ops/blade-develop/src/test/resources/templates/controller.java.vm b/blade-ops/blade-develop/src/test/resources/templates/controller.java.vm index f9393d7..58762e2 100644 --- a/blade-ops/blade-develop/src/test/resources/templates/controller.java.vm +++ b/blade-ops/blade-develop/src/test/resources/templates/controller.java.vm @@ -134,7 +134,7 @@ public class $!{table.controllerName} { @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status($!{table.entityPath}Service.deleteLogic(Func.toIntList(ids))); + return R.status($!{table.entityPath}Service.deleteLogic(Func.toLongList(ids))); } #else @@ -146,7 +146,7 @@ public class $!{table.controllerName} { @ApiOperationSupport(order = 7) @ApiOperation(value = "删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status($!{table.entityPath}Service.removeByIds(Func.toIntList(ids))); + return R.status($!{table.entityPath}Service.removeByIds(Func.toLongList(ids))); } #end diff --git a/blade-ops/blade-resource/pom.xml b/blade-ops/blade-resource/pom.xml index be49f6a..a3628a5 100644 --- a/blade-ops/blade-resource/pom.xml +++ b/blade-ops/blade-resource/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-ops/blade-seata-order/pom.xml b/blade-ops/blade-seata-order/pom.xml index 9a042ed..b55dca0 100644 --- a/blade-ops/blade-seata-order/pom.xml +++ b/blade-ops/blade-seata-order/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-ops/blade-seata-storage/pom.xml b/blade-ops/blade-seata-storage/pom.xml index aceac62..3bf8f0a 100644 --- a/blade-ops/blade-seata-storage/pom.xml +++ b/blade-ops/blade-seata-storage/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-ops/pom.xml b/blade-ops/pom.xml index 1dcdaad..bf1daa1 100644 --- a/blade-ops/pom.xml +++ b/blade-ops/pom.xml @@ -5,7 +5,7 @@ SpringBlade org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-service-api/blade-demo-api/pom.xml b/blade-service-api/blade-demo-api/pom.xml index f7c5ece..8fe8c92 100644 --- a/blade-service-api/blade-demo-api/pom.xml +++ b/blade-service-api/blade-demo-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-service-api/blade-demo-api/src/main/java/com/example/demo/entity/Notice.java b/blade-service-api/blade-demo-api/src/main/java/com/example/demo/entity/Notice.java index c58ab24..9f1727a 100644 --- a/blade-service-api/blade-demo-api/src/main/java/com/example/demo/entity/Notice.java +++ b/blade-service-api/blade-demo-api/src/main/java/com/example/demo/entity/Notice.java @@ -19,6 +19,8 @@ package com.example.demo.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -41,9 +43,10 @@ public class Notice extends BaseEntity { /** * 主键id */ - @TableId(value = "id", type = IdType.AUTO) - @ApiModelProperty(value = "主键id") - private Integer id; + @ApiModelProperty(value = "主键") + @TableId(value = "id", type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 标题 diff --git a/blade-service-api/blade-desk-api/pom.xml b/blade-service-api/blade-desk-api/pom.xml index 5537491..fa9794e 100644 --- a/blade-service-api/blade-desk-api/pom.xml +++ b/blade-service-api/blade-desk-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/entity/Notice.java b/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/entity/Notice.java index 6df6af9..ee07c33 100644 --- a/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/entity/Notice.java +++ b/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/entity/Notice.java @@ -18,6 +18,8 @@ package org.springblade.desk.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -40,9 +42,10 @@ public class Notice extends BaseEntity { /** * 主键id */ - @TableId(value = "id", type = IdType.AUTO) - @ApiModelProperty(value = "主键id") - private Integer id; + @ApiModelProperty(value = "主键") + @TableId(value = "id", type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 标题 diff --git a/blade-service-api/blade-dict-api/pom.xml b/blade-service-api/blade-dict-api/pom.xml index 0258ad7..eaaf8be 100644 --- a/blade-service-api/blade-dict-api/pom.xml +++ b/blade-service-api/blade-dict-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/entity/Dict.java b/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/entity/Dict.java index 9f6808f..ea05ce2 100644 --- a/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/entity/Dict.java +++ b/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/entity/Dict.java @@ -19,6 +19,8 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -42,14 +44,16 @@ public class Dict implements Serializable { * 主键 */ @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; + @TableId(value = "id", type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 父主键 */ @ApiModelProperty(value = "父主键") - private Integer parentId; + @JsonSerialize(using = ToStringSerializer.class) + private Long parentId; /** * 字典码 diff --git a/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/vo/DictVO.java b/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/vo/DictVO.java index d532627..739d87e 100644 --- a/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/vo/DictVO.java +++ b/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/vo/DictVO.java @@ -16,6 +16,8 @@ package org.springblade.system.vo; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import lombok.Data; import lombok.EqualsAndHashCode; @@ -39,12 +41,14 @@ public class DictVO extends Dict implements INode { /** * 主键ID */ - private Integer id; + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 父节点ID */ - private Integer parentId; + @JsonSerialize(using = ToStringSerializer.class) + private Long parentId; /** * 子孙节点 diff --git a/blade-service-api/blade-system-api/pom.xml b/blade-service-api/blade-system-api/pom.xml index 038b9b5..9ab44e1 100644 --- a/blade-service-api/blade-system-api/pom.xml +++ b/blade-service-api/blade-system-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/AuthClient.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/AuthClient.java index a10c8bb..0d2cee1 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/AuthClient.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/AuthClient.java @@ -18,6 +18,8 @@ package org.springblade.system.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -41,9 +43,10 @@ public class AuthClient extends BaseEntity { /** * 主键id */ - @TableId(value = "id", type = IdType.AUTO) - @ApiModelProperty(value = "主键id") - private Integer id; + @ApiModelProperty(value = "主键") + @TableId(value = "id", type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 客户端id diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Dept.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Dept.java index 827a975..9350877 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Dept.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Dept.java @@ -19,6 +19,8 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -41,8 +43,9 @@ public class Dept implements Serializable { * 主键 */ @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; + @TableId(value = "id", type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 租户ID @@ -54,7 +57,8 @@ public class Dept implements Serializable { * 父主键 */ @ApiModelProperty(value = "父主键") - private Integer parentId; + @JsonSerialize(using = ToStringSerializer.class) + private Long parentId; /** * 部门名 diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Menu.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Menu.java index 94a97bf..f044897 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Menu.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Menu.java @@ -19,6 +19,8 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -42,14 +44,16 @@ public class Menu implements Serializable { * 主键 */ @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; + @TableId(value = "id", type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 菜单父主键 */ - @ApiModelProperty(value = "菜单父主键") - private Integer parentId; + @ApiModelProperty(value = "父主键") + @JsonSerialize(using = ToStringSerializer.class) + private Long parentId; /** * 菜单编号 diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Param.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Param.java index d9261f2..18cd575 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Param.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Param.java @@ -18,6 +18,8 @@ package org.springblade.system.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -40,9 +42,10 @@ public class Param extends BaseEntity { /** * 主键id */ - @TableId(value = "id", type = IdType.AUTO) - @ApiModelProperty(value = "主键id") - private Integer id; + @ApiModelProperty(value = "主键") + @TableId(value = "id", type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 参数名 diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Post.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Post.java new file mode 100644 index 0000000..782dd94 --- /dev/null +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Post.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springblade.system.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.TenantEntity; + +/** + * 岗位表实体类 + * + * @author Chill + */ +@Data +@TableName("blade_post") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "Post对象", description = "岗位表") +public class Post extends TenantEntity { + + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + @ApiModelProperty(value = "主键") + @TableId(value = "id", type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + /** + * 类型 + */ + @ApiModelProperty(value = "类型") + private Integer category; + /** + * 岗位编号 + */ + @ApiModelProperty(value = "岗位编号") + private String postCode; + /** + * 岗位名称 + */ + @ApiModelProperty(value = "岗位名称") + private String postName; + /** + * 岗位排序 + */ + @ApiModelProperty(value = "岗位排序") + private Integer sort; + /** + * 岗位描述 + */ + @ApiModelProperty(value = "岗位描述") + private String remark; + + +} diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Role.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Role.java index 5487a07..d83cd7d 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Role.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Role.java @@ -19,6 +19,8 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -41,8 +43,9 @@ public class Role implements Serializable { * 主键 */ @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; + @TableId(value = "id", type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 租户ID @@ -54,7 +57,8 @@ public class Role implements Serializable { * 父主键 */ @ApiModelProperty(value = "父主键") - private Integer parentId; + @JsonSerialize(using = ToStringSerializer.class) + private Long parentId; /** * 角色名 diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleMenu.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleMenu.java index 06d146d..66d9eae 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleMenu.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleMenu.java @@ -18,6 +18,8 @@ package org.springblade.system.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -40,20 +42,23 @@ public class RoleMenu implements Serializable { * 主键 */ @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; + @TableId(value = "id", type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 菜单id */ @ApiModelProperty(value = "菜单id") - private Integer menuId; + @JsonSerialize(using = ToStringSerializer.class) + private Long menuId; /** * 角色id */ @ApiModelProperty(value = "角色id") - private Integer roleId; + @JsonSerialize(using = ToStringSerializer.class) + private Long roleId; } diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Tenant.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Tenant.java index 517a9af..adad110 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Tenant.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Tenant.java @@ -18,6 +18,8 @@ package org.springblade.system.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -40,9 +42,10 @@ public class Tenant extends BaseEntity { /** * 主键id */ - @TableId(value = "id", type = IdType.AUTO) - @ApiModelProperty(value = "主键id") - private Integer id; + @ApiModelProperty(value = "主键") + @TableId(value = "id", type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 租户ID diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/feign/ISysClient.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/feign/ISysClient.java index a705c4a..80754ba 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/feign/ISysClient.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/feign/ISysClient.java @@ -22,6 +22,8 @@ import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; +import java.util.List; + /** * Feign接口类 * @@ -35,14 +37,6 @@ public interface ISysClient { String API_PREFIX = "/sys"; - /** - * 获取部门名 - * - * @param id 主键 - * @return 部门名 - */ - @GetMapping(API_PREFIX + "/getDeptName") - String getDeptName(@RequestParam("id") Integer id); /** * 获取部门 @@ -51,25 +45,55 @@ public interface ISysClient { * @return Dept */ @GetMapping(API_PREFIX + "/getDept") - Dept getDept(@RequestParam("id") Integer id); + Dept getDept(@RequestParam("id") Long id); /** - * 获取角色名 + * 获取部门名 * * @param id 主键 - * @return 角色名 + * @return 部门名 */ - @GetMapping(API_PREFIX + "/getRoleName") - String getRoleName(@RequestParam("id") Integer id); + @GetMapping(API_PREFIX + "/getDeptName") + String getDeptName(@RequestParam("id") Long id); /** - * 获取角色别名 + * 获取部门id * - * @param id 主键 - * @return 角色别名 + * @param tenantId 租户id + * @param deptNames 部门名 + * @return 部门id */ - @GetMapping(API_PREFIX + "/getRoleAlias") - String getRoleAlias(@RequestParam("id") Integer id); + @GetMapping(API_PREFIX + "/getDeptIds") + String getDeptIds(@RequestParam("tenantId") String tenantId, @RequestParam("deptNames") String deptNames); + + /** + * 获取部门名 + * + * @param deptIds 主键 + * @return + */ + @GetMapping(API_PREFIX + "/getDeptNames") + List getDeptNames(@RequestParam("deptIds") String deptIds); + + /** + * 获取岗位id + * + * @param tenantId 租户id + * @param postNames 岗位名 + * @return 岗位id + */ + @GetMapping(API_PREFIX + "/getPostIds") + String getPostIds(@RequestParam("tenantId") String tenantId, @RequestParam("postNames") String postNames); + + /** + * 获取岗位名 + * + * @param postIds 主键 + * @return + */ + @GetMapping(API_PREFIX + "/getPostNames") + List getPostNames(@RequestParam("postIds") String postIds); + /** * 获取角色 @@ -78,6 +102,43 @@ public interface ISysClient { * @return Role */ @GetMapping(API_PREFIX + "/getRole") - Role getRole(@RequestParam("id") Integer id); + Role getRole(@RequestParam("id") Long id); + + /** + * 获取角色id + * + * @param tenantId 租户id + * @param roleNames 角色名 + * @return 角色id + */ + @GetMapping(API_PREFIX + "/getRoleIds") + String getRoleIds(@RequestParam("tenantId") String tenantId, @RequestParam("roleNames") String roleNames); + + /** + * 获取角色名 + * + * @param id 主键 + * @return 角色名 + */ + @GetMapping(API_PREFIX + "/getRoleName") + String getRoleName(@RequestParam("id") Long id); + + /** + * 获取角色名 + * + * @param roleIds 主键 + * @return + */ + @GetMapping(API_PREFIX + "/getRoleNames") + List getRoleNames(@RequestParam("roleIds") String roleIds); + + /** + * 获取角色别名 + * + * @param id 主键 + * @return 角色别名 + */ + @GetMapping(API_PREFIX + "/getRoleAlias") + String getRoleAlias(@RequestParam("id") Long id); } diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/feign/ISysClientFallback.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/feign/ISysClientFallback.java index 2ce4b3d..710cc87 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/feign/ISysClientFallback.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/feign/ISysClientFallback.java @@ -19,6 +19,8 @@ import org.springblade.system.entity.Dept; import org.springblade.system.entity.Role; import org.springframework.stereotype.Component; +import java.util.List; + /** * Feign失败配置 * @@ -26,28 +28,59 @@ import org.springframework.stereotype.Component; */ @Component public class ISysClientFallback implements ISysClient { + @Override - public String getDeptName(Integer id) { + public Dept getDept(Long id) { return null; } @Override - public Dept getDept(Integer id) { + public String getDeptName(Long id) { return null; } @Override - public String getRoleName(Integer id) { + public String getDeptIds(String tenantId, String deptNames) { return null; } @Override - public String getRoleAlias(Integer id) { + public List getDeptNames(String deptIds) { return null; } @Override - public Role getRole(Integer id) { + public String getPostIds(String tenantId, String postNames) { + return null; + } + + @Override + public List getPostNames(String postIds) { + return null; + } + + @Override + public Role getRole(Long id) { + return null; + } + + @Override + public String getRoleIds(String tenantId, String roleNames) { + return null; + } + + @Override + public String getRoleName(Long id) { + return null; + } + + @Override + public List getRoleNames(String roleIds) { + return null; + } + + @Override + public String getRoleAlias(Long id) { return null; } } diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DeptVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DeptVO.java index 5a2c0fa..80bcb39 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DeptVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DeptVO.java @@ -16,6 +16,8 @@ package org.springblade.system.vo; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import lombok.Data; import lombok.EqualsAndHashCode; @@ -39,12 +41,14 @@ public class DeptVO extends Dept implements INode { /** * 主键ID */ - private Integer id; + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 父节点ID */ - private Integer parentId; + @JsonSerialize(using = ToStringSerializer.class) + private Long parentId; /** * 子孙节点 diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/MenuVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/MenuVO.java index 6ca3d87..b27071f 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/MenuVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/MenuVO.java @@ -16,6 +16,8 @@ package org.springblade.system.vo; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import lombok.Data; import lombok.EqualsAndHashCode; @@ -39,12 +41,14 @@ public class MenuVO extends Menu implements INode { /** * 主键ID */ - private Integer id; + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 父节点ID */ - private Integer parentId; + @JsonSerialize(using = ToStringSerializer.class) + private Long parentId; /** * 子孙节点 diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/PostVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/PostVO.java new file mode 100644 index 0000000..dff4c49 --- /dev/null +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/PostVO.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springblade.system.vo; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.system.entity.Post; + +/** + * 岗位表视图实体类 + * + * @author Chill + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "PostVO对象", description = "岗位表") +public class PostVO extends Post { + private static final long serialVersionUID = 1L; + + /** + * 岗位分类名 + */ + private String categoryName; + +} diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleVO.java index 34d7149..53f7bec 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleVO.java @@ -16,6 +16,8 @@ package org.springblade.system.vo; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import lombok.Data; import lombok.EqualsAndHashCode; @@ -39,12 +41,14 @@ public class RoleVO extends Role implements INode { /** * 主键ID */ - private Integer id; + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 父节点ID */ - private Integer parentId; + @JsonSerialize(using = ToStringSerializer.class) + private Long parentId; /** * 子孙节点 diff --git a/blade-service-api/blade-user-api/pom.xml b/blade-service-api/blade-user-api/pom.xml index c67feab..acdedd4 100644 --- a/blade-service-api/blade-user-api/pom.xml +++ b/blade-service-api/blade-user-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/User.java b/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/User.java index ce37a3c..a38d1b2 100644 --- a/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/User.java +++ b/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/User.java @@ -18,6 +18,8 @@ package org.springblade.system.user.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -40,10 +42,16 @@ public class User extends TenantEntity { /** * 主键id */ - @TableId(value = "id", type = IdType.AUTO) - @ApiModelProperty(value = "主键id") - private Integer id; + @ApiModelProperty(value = "主键") + @TableId(value = "id", type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + /** + * 编号 + */ + private String code; /** * 账号 */ @@ -88,6 +96,10 @@ public class User extends TenantEntity { * 部门id */ private String deptId; + /** + * 部门id + */ + private String postId; } diff --git a/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/vo/UserVO.java b/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/vo/UserVO.java index 16b0658..0f4f767 100644 --- a/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/vo/UserVO.java +++ b/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/vo/UserVO.java @@ -15,6 +15,8 @@ */ package org.springblade.system.user.vo; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import lombok.Data; import lombok.EqualsAndHashCode; @@ -34,7 +36,8 @@ public class UserVO extends User { /** * 主键ID */ - private Integer id; + @JsonSerialize(using = ToStringSerializer.class) + private Long id; /** * 角色名 @@ -46,6 +49,11 @@ public class UserVO extends User { */ private String deptName; + /** + * 岗位名 + */ + private String postName; + /** * 性别 */ diff --git a/blade-service-api/pom.xml b/blade-service-api/pom.xml index 1309cf5..84af2a6 100644 --- a/blade-service-api/pom.xml +++ b/blade-service-api/pom.xml @@ -5,13 +5,13 @@ SpringBlade org.springblade - 2.6.2 + 2.7.0 4.0.0 blade-service-api ${project.artifactId} - 2.6.2 + 2.7.0 pom SpringBlade 微服务API集合 diff --git a/blade-service/blade-demo/pom.xml b/blade-service/blade-demo/pom.xml index 3d14754..3192e0c 100644 --- a/blade-service/blade-demo/pom.xml +++ b/blade-service/blade-demo/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/controller/NoticeController.java b/blade-service/blade-demo/src/main/java/com/example/demo/controller/NoticeController.java index 553e46f..88b8d21 100644 --- a/blade-service/blade-demo/src/main/java/com/example/demo/controller/NoticeController.java +++ b/blade-service/blade-demo/src/main/java/com/example/demo/controller/NoticeController.java @@ -109,7 +109,7 @@ public class NoticeController extends BladeController implements CacheNames { @ApiOperationSupport(order = 6) @ApiOperation(value = "逻辑删除", notes = "传入notice") public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { - boolean temp = noticeService.deleteLogic(Func.toIntList(ids)); + boolean temp = noticeService.deleteLogic(Func.toLongList(ids)); return R.status(temp); } diff --git a/blade-service/blade-desk/pom.xml b/blade-service/blade-desk/pom.xml index 516448c..75d332e 100644 --- a/blade-service/blade-desk/pom.xml +++ b/blade-service/blade-desk/pom.xml @@ -6,7 +6,7 @@ org.springblade blade-service - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/NoticeController.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/NoticeController.java index 863bbea..cbdf267 100644 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/NoticeController.java +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/NoticeController.java @@ -114,7 +114,7 @@ public class NoticeController extends BladeController implements CacheNames { @ApiOperationSupport(order = 6) @ApiOperation(value = "逻辑删除", notes = "传入notice") public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { - boolean temp = noticeService.deleteLogic(Func.toIntList(ids)); + boolean temp = noticeService.deleteLogic(Func.toLongList(ids)); return R.status(temp); } diff --git a/blade-service/blade-log/pom.xml b/blade-service/blade-log/pom.xml index e96b700..93873ee 100644 --- a/blade-service/blade-log/pom.xml +++ b/blade-service/blade-log/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-service/blade-system/pom.xml b/blade-service/blade-system/pom.xml index 1d7b70b..95d19f1 100644 --- a/blade-service/blade-system/pom.xml +++ b/blade-service/blade-system/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 2.6.2 + 2.7.0 4.0.0 diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/AuthClientController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/AuthClientController.java index 93f0611..6d4e346 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/AuthClientController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/AuthClientController.java @@ -110,7 +110,7 @@ public class AuthClientController extends BladeController { @ApiOperationSupport(order = 6) @ApiOperation(value = "逻辑删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(clientService.deleteLogic(Func.toIntList(ids))); + return R.status(clientService.deleteLogic(Func.toLongList(ids))); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java index fc51f21..5e161cc 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java @@ -110,7 +110,7 @@ public class DeptController extends BladeController { @ApiOperationSupport(order = 5) @ApiOperation(value = "删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(deptService.removeByIds(Func.toIntList(ids))); + return R.status(deptService.removeByIds(Func.toLongList(ids))); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictController.java index 2473dfa..fcd3926 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictController.java @@ -110,7 +110,7 @@ public class DictController extends BladeController { @ApiOperationSupport(order = 5) @ApiOperation(value = "删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(dictService.removeByIds(Func.toIntList(ids))); + return R.status(dictService.removeByIds(Func.toLongList(ids))); } /** diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java index b0270db..ad2d9c1 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java @@ -99,7 +99,7 @@ public class MenuController extends BladeController { @ApiOperationSupport(order = 4) @ApiOperation(value = "删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(menuService.removeByIds(Func.toIntList(ids))); + return R.status(menuService.removeByIds(Func.toLongList(ids))); } /** diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/ParamController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/ParamController.java index 48fa265..120f4c7 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/ParamController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/ParamController.java @@ -90,7 +90,7 @@ public class ParamController extends BladeController { @ApiOperationSupport(order = 4) @ApiOperation(value = "逻辑删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(paramService.deleteLogic(Func.toIntList(ids))); + return R.status(paramService.deleteLogic(Func.toLongList(ids))); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/PostController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/PostController.java new file mode 100644 index 0000000..fe6c8b2 --- /dev/null +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/PostController.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springblade.system.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springblade.system.entity.Post; +import org.springblade.system.service.IPostService; +import org.springblade.system.vo.PostVO; +import org.springblade.system.wrapper.PostWrapper; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 岗位表 控制器 + * + * @author Chill + */ +@RestController +@AllArgsConstructor +@RequestMapping("/post") +@Api(value = "岗位表", tags = "岗位表接口") +public class PostController extends BladeController { + + private IPostService postService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入post") + public R detail(Post post) { + Post detail = postService.getOne(Condition.getQueryWrapper(post)); + return R.data(PostWrapper.build().entityVO(detail)); + } + + /** + * 分页 岗位表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入post") + public R> list(Post post, Query query) { + IPage pages = postService.page(Condition.getPage(query), Condition.getQueryWrapper(post)); + return R.data(PostWrapper.build().pageVO(pages)); + } + + + /** + * 自定义分页 岗位表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入post") + public R> page(PostVO post, Query query) { + IPage pages = postService.selectPostPage(Condition.getPage(query), post); + return R.data(pages); + } + + /** + * 新增 岗位表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入post") + public R save(@Valid @RequestBody Post post) { + return R.status(postService.save(post)); + } + + /** + * 修改 岗位表 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入post") + public R update(@Valid @RequestBody Post post) { + return R.status(postService.updateById(post)); + } + + /** + * 新增或修改 岗位表 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入post") + public R submit(@Valid @RequestBody Post post) { + return R.status(postService.saveOrUpdate(post)); + } + + + /** + * 删除 岗位表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(postService.deleteLogic(Func.toLongList(ids))); + } + + /** + * 下拉数据源 + */ + @GetMapping("/select") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "下拉数据源", notes = "传入post") + public R> select(String tenantId, BladeUser bladeUser) { + List list = postService.list(Wrappers.query().lambda().eq(Post::getTenantId, Func.toStr(tenantId, bladeUser.getTenantId()))); + return R.data(list); + } + +} diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java index e1ea79e..619a991 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java @@ -109,7 +109,7 @@ public class RoleController extends BladeController { @ApiOperationSupport(order = 5) @ApiOperation(value = "删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(roleService.removeByIds(Func.toIntList(ids))); + return R.status(roleService.removeByIds(Func.toLongList(ids))); } /** @@ -124,7 +124,7 @@ public class RoleController extends BladeController { @ApiOperation(value = "权限设置", notes = "传入roleId集合以及menuId集合") public R grant(@ApiParam(value = "roleId集合", required = true) @RequestParam String roleIds, @ApiParam(value = "menuId集合", required = true) @RequestParam String menuIds) { - boolean temp = roleService.grant(Func.toIntList(roleIds), Func.toIntList(menuIds)); + boolean temp = roleService.grant(Func.toLongList(roleIds), Func.toLongList(menuIds)); return R.status(temp); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java index c121f4b..ccbcea2 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java @@ -112,7 +112,7 @@ public class TenantController extends BladeController { @PostMapping("/remove") @ApiOperation(value = "逻辑删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(tenantService.deleteLogic(Func.toIntList(ids))); + return R.status(tenantService.deleteLogic(Func.toLongList(ids))); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/feign/SysClient.java b/blade-service/blade-system/src/main/java/org/springblade/system/feign/SysClient.java index ab84373..e4c4158 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/feign/SysClient.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/feign/SysClient.java @@ -19,11 +19,14 @@ import lombok.AllArgsConstructor; import org.springblade.system.entity.Dept; import org.springblade.system.entity.Role; import org.springblade.system.service.IDeptService; +import org.springblade.system.service.IPostService; import org.springblade.system.service.IRoleService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; +import java.util.List; + /** * 系统服务Feign实现类 * @@ -34,37 +37,69 @@ import springfox.documentation.annotations.ApiIgnore; @AllArgsConstructor public class SysClient implements ISysClient { - IDeptService deptService; + private IDeptService deptService; - IRoleService roleService; + private IPostService postService; - @Override - @GetMapping(API_PREFIX + "/getDeptName") - public String getDeptName(Integer id) { - return deptService.getById(id).getDeptName(); - } + private IRoleService roleService; @Override @GetMapping(API_PREFIX + "/getDept") - public Dept getDept(Integer id) { + public Dept getDept(Long id) { return deptService.getById(id); } @Override - @GetMapping(API_PREFIX + "/getRoleName") - public String getRoleName(Integer id) { - return roleService.getById(id).getRoleName(); + @GetMapping(API_PREFIX + "/getDeptName") + public String getDeptName(Long id) { + return deptService.getById(id).getDeptName(); } @Override - @GetMapping(API_PREFIX + "/getRoleAlias") - public String getRoleAlias(Integer id) { - return roleService.getById(id).getRoleAlias(); + public String getDeptIds(String tenantId, String deptNames) { + return deptService.getDeptIds(tenantId, deptNames); + } + + @Override + public List getDeptNames(String deptIds) { + return deptService.getDeptNames(deptIds); + } + + @Override + public String getPostIds(String tenantId, String postNames) { + return postService.getPostIds(tenantId, postNames); + } + + @Override + public List getPostNames(String postIds) { + return postService.getPostNames(postIds); } @Override @GetMapping(API_PREFIX + "/getRole") - public Role getRole(Integer id) { + public Role getRole(Long id) { return roleService.getById(id); } + + @Override + public String getRoleIds(String tenantId, String roleNames) { + return roleService.getRoleIds(tenantId, roleNames); + } + + @Override + @GetMapping(API_PREFIX + "/getRoleName") + public String getRoleName(Long id) { + return roleService.getById(id).getRoleName(); + } + + @Override + public List getRoleNames(String roleIds) { + return roleService.getRoleNames(roleIds); + } + + @Override + @GetMapping(API_PREFIX + "/getRoleAlias") + public String getRoleAlias(Long id) { + return roleService.getById(id).getRoleAlias(); + } } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.java index b4bf068..2ac6f77 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.java @@ -46,4 +46,12 @@ public interface DeptMapper extends BaseMapper { */ List tree(String tenantId); + /** + * 获取部门名 + * + * @param ids + * @return + */ + List getDeptNames(Long[] ids); + } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml index d3b0a82..2c60cf7 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml +++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml @@ -38,4 +38,17 @@ + + diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.java index 04c32f1..771bfae 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.java @@ -59,7 +59,7 @@ public interface MenuMapper extends BaseMapper

{ * @param roleId * @return */ - List grantTreeByRole(List roleId); + List grantTreeByRole(List roleId); /** * 所有菜单 @@ -74,7 +74,7 @@ public interface MenuMapper extends BaseMapper { * @param roleId * @return */ - List roleMenu(List roleId); + List roleMenu(List roleId); /** * 菜单树形结构 @@ -82,7 +82,7 @@ public interface MenuMapper extends BaseMapper { * @param roleId * @return */ - List routes(List roleId); + List routes(List roleId); /** * 按钮树形结构 @@ -90,7 +90,7 @@ public interface MenuMapper extends BaseMapper { * @param roleId * @return */ - List buttons(List roleId); + List buttons(List roleId); /** * 获取配置的角色权限 @@ -98,5 +98,5 @@ public interface MenuMapper extends BaseMapper { * @param roleIds * @return */ - List authRoutes(List roleIds); + List authRoutes(List roleIds); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/PostMapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/PostMapper.java new file mode 100644 index 0000000..233eb2d --- /dev/null +++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/PostMapper.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springblade.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.system.entity.Post; +import org.springblade.system.vo.PostVO; + +import java.util.List; + +/** + * 岗位表 Mapper 接口 + * + * @author Chill + */ +public interface PostMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param post + * @return + */ + List selectPostPage(IPage page, PostVO post); + + /** + * 获取岗位名 + * + * @param ids + * @return + */ + List getPostNames(Long[] ids); + +} diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/PostMapper.xml b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/PostMapper.xml new file mode 100644 index 0000000..e4106d8 --- /dev/null +++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/PostMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RoleMapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RoleMapper.java index 5f60302..0a9197f 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RoleMapper.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RoleMapper.java @@ -47,4 +47,12 @@ public interface RoleMapper extends BaseMapper { */ List tree(String tenantId, String excludeRole); + /** + * 获取角色名 + * + * @param ids + * @return + */ + List getRoleNames(Long[] ids); + } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RoleMapper.xml b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RoleMapper.xml index 1f5c9de..07e5631 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RoleMapper.xml +++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RoleMapper.xml @@ -40,4 +40,17 @@ + + diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/IDeptService.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/IDeptService.java index 2e34cd0..5d13740 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/IDeptService.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/IDeptService.java @@ -46,4 +46,21 @@ public interface IDeptService extends IService { */ List tree(String tenantId); + /** + * 获取部门ID + * + * @param tenantId + * @param deptNames + * @return + */ + String getDeptIds(String tenantId, String deptNames); + + /** + * 获取部门名 + * + * @param deptIds + * @return + */ + List getDeptNames(String deptIds); + } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/IPostService.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/IPostService.java new file mode 100644 index 0000000..d0f2d5b --- /dev/null +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/IPostService.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springblade.system.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import org.springblade.system.entity.Post; +import org.springblade.system.vo.PostVO; + +import java.util.List; + +/** + * 岗位表 服务类 + * + * @author Chill + */ +public interface IPostService extends BaseService { + + /** + * 自定义分页 + * + * @param page + * @param post + * @return + */ + IPage selectPostPage(IPage page, PostVO post); + + /** + * 获取岗位ID + * + * @param tenantId + * @param postNames + * @return + */ + String getPostIds(String tenantId, String postNames); + + /** + * 获取岗位名 + * + * @param postIds + * @return + */ + List getPostNames(String postIds); + +} diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/IRoleService.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/IRoleService.java index 97771b4..544fffd 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/IRoleService.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/IRoleService.java @@ -54,6 +54,23 @@ public interface IRoleService extends IService { * @param menuIds 菜单id集合 * @return 是否成功 */ - boolean grant(@NotEmpty List roleIds, @NotEmpty List menuIds); + boolean grant(@NotEmpty List roleIds, @NotEmpty List menuIds); + + /** + * 获取角色ID + * + * @param tenantId + * @param roleNames + * @return + */ + String getRoleIds(String tenantId, String roleNames); + + /** + * 获取角色名 + * + * @param roleIds + * @return + */ + List getRoleNames(String roleIds); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java index 7d609d7..78ac00b 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java @@ -16,8 +16,10 @@ package org.springblade.system.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springblade.core.tool.node.ForestNodeMerger; +import org.springblade.core.tool.utils.Func; import org.springblade.system.entity.Dept; import org.springblade.system.mapper.DeptMapper; import org.springblade.system.service.IDeptService; @@ -25,6 +27,7 @@ import org.springblade.system.vo.DeptVO; import org.springframework.stereotype.Service; import java.util.List; +import java.util.stream.Collectors; /** * 服务实现类 @@ -44,4 +47,18 @@ public class DeptServiceImpl extends ServiceImpl implements ID return ForestNodeMerger.merge(baseMapper.tree(tenantId)); } + @Override + public String getDeptIds(String tenantId, String deptNames) { + List deptList = baseMapper.selectList(Wrappers.query().lambda().eq(Dept::getTenantId, tenantId).in(Dept::getDeptName, Func.toStrList(deptNames))); + if (deptList != null && deptList.size() > 0) { + return deptList.stream().map(dept -> Func.toStr(dept.getId())).distinct().collect(Collectors.joining(",")); + } + return null; + } + + @Override + public List getDeptNames(String deptIds) { + return baseMapper.getDeptNames(Func.toLongArray(deptIds)); + } + } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java index eb927a6..4902d0f 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java @@ -56,7 +56,7 @@ public class MenuServiceImpl extends ServiceImpl implements IM @Override public List routes(String roleId) { List

allMenus = baseMapper.allMenu(); - List roleMenus = baseMapper.roleMenu(Func.toIntList(roleId)); + List roleMenus = baseMapper.roleMenu(Func.toLongList(roleId)); List routes = new LinkedList<>(roleMenus); roleMenus.forEach(roleMenu -> recursion(allMenus, routes, roleMenu)); routes.sort(Comparator.comparing(Menu::getSort)); @@ -75,7 +75,7 @@ public class MenuServiceImpl extends ServiceImpl implements IM @Override public List buttons(String roleId) { - List buttons = baseMapper.buttons(Func.toIntList(roleId)); + List buttons = baseMapper.buttons(Func.toLongList(roleId)); MenuWrapper menuWrapper = new MenuWrapper(); return menuWrapper.listNodeVO(buttons); } @@ -87,12 +87,12 @@ public class MenuServiceImpl extends ServiceImpl implements IM @Override public List grantTree(BladeUser user) { - return ForestNodeMerger.merge(user.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? baseMapper.grantTree() : baseMapper.grantTreeByRole(Func.toIntList(user.getRoleId()))); + return ForestNodeMerger.merge(user.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? baseMapper.grantTree() : baseMapper.grantTreeByRole(Func.toLongList(user.getRoleId()))); } @Override public List roleTreeKeys(String roleIds) { - List roleMenus = roleMenuService.list(Wrappers.query().lambda().in(RoleMenu::getRoleId, Func.toIntList(roleIds))); + List roleMenus = roleMenuService.list(Wrappers.query().lambda().in(RoleMenu::getRoleId, Func.toLongList(roleIds))); return roleMenus.stream().map(roleMenu -> Func.toStr(roleMenu.getMenuId())).collect(Collectors.toList()); } @@ -101,7 +101,7 @@ public class MenuServiceImpl extends ServiceImpl implements IM if (Func.isEmpty(user)) { return null; } - List routes = baseMapper.authRoutes(Func.toIntList(user.getRoleId())); + List routes = baseMapper.authRoutes(Func.toLongList(user.getRoleId())); List list = new ArrayList<>(); routes.forEach(route -> list.add(Kv.init().set(route.getPath(), Kv.init().set("authority", Func.toStrArray(route.getAlias()))))); return list; diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/PostServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/PostServiceImpl.java new file mode 100644 index 0000000..6c57028 --- /dev/null +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/PostServiceImpl.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springblade.system.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.Func; +import org.springblade.system.entity.Post; +import org.springblade.system.mapper.PostMapper; +import org.springblade.system.service.IPostService; +import org.springblade.system.vo.PostVO; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 岗位表 服务实现类 + * + * @author Chill + */ +@Service +public class PostServiceImpl extends BaseServiceImpl implements IPostService { + + @Override + public IPage selectPostPage(IPage page, PostVO post) { + return page.setRecords(baseMapper.selectPostPage(page, post)); + } + + @Override + public String getPostIds(String tenantId, String postNames) { + List postList = baseMapper.selectList(Wrappers.query().lambda().eq(Post::getTenantId, tenantId).in(Post::getPostName, Func.toStrList(postNames))); + if (postList != null && postList.size() > 0) { + return postList.stream().map(post -> Func.toStr(post.getId())).distinct().collect(Collectors.joining(",")); + } + return null; + } + + @Override + public List getPostNames(String postIds) { + return baseMapper.getPostNames(Func.toLongArray(postIds)); + } + +} diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java index 3bb62dc..ee4827a 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java @@ -36,6 +36,7 @@ import org.springframework.validation.annotation.Validated; import javax.validation.constraints.NotEmpty; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * 服务实现类 @@ -65,7 +66,7 @@ public class RoleServiceImpl extends ServiceImpl implements IR } @Override - public boolean grant(@NotEmpty List roleIds, @NotEmpty List menuIds) { + public boolean grant(@NotEmpty List roleIds, @NotEmpty List menuIds) { // 删除角色配置的菜单集合 roleMenuService.remove(Wrappers.update().lambda().in(RoleMenu::getRoleId, roleIds)); // 组装配置 @@ -80,4 +81,18 @@ public class RoleServiceImpl extends ServiceImpl implements IR return roleMenuService.saveBatch(roleMenus); } + @Override + public String getRoleIds(String tenantId, String roleNames) { + List roleList = baseMapper.selectList(Wrappers.query().lambda().eq(Role::getTenantId, tenantId).in(Role::getRoleName, Func.toStrList(roleNames))); + if (roleList != null && roleList.size() > 0) { + return roleList.stream().map(role -> Func.toStr(role.getId())).distinct().collect(Collectors.joining(",")); + } + return null; + } + + @Override + public List getRoleNames(String roleIds) { + return baseMapper.getRoleNames(Func.toLongArray(roleIds)); + } + } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java index d39bdef..0e566ac 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java @@ -64,7 +64,7 @@ public class TenantServiceImpl extends BaseServiceImpl imp // 新建租户对应的默认角色 Role role = new Role(); role.setTenantId(tenantId); - role.setParentId(0); + role.setParentId(0L); role.setRoleName("管理员"); role.setRoleAlias("admin"); role.setSort(2); @@ -73,7 +73,7 @@ public class TenantServiceImpl extends BaseServiceImpl imp // 新建租户对应的默认部门 Dept dept = new Dept(); dept.setTenantId(tenantId); - dept.setParentId(0); + dept.setParentId(0L); dept.setDeptName(tenant.getTenantName()); dept.setFullName(tenant.getTenantName()); dept.setSort(2); diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/PostWrapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/PostWrapper.java new file mode 100644 index 0000000..6707aaa --- /dev/null +++ b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/PostWrapper.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springblade.system.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.SpringUtil; +import org.springblade.system.entity.Post; +import org.springblade.system.service.IDictService; +import org.springblade.system.vo.PostVO; + +import java.util.Objects; + +/** + * 岗位表包装类,返回视图层所需的字段 + * + * @author Chill + */ +public class PostWrapper extends BaseEntityWrapper { + + private static IDictService dictService; + + static { + dictService = SpringUtil.getBean(IDictService.class); + } + + public static PostWrapper build() { + return new PostWrapper(); + } + + @Override + public PostVO entityVO(Post post) { + PostVO postVO = Objects.requireNonNull(BeanUtil.copy(post, PostVO.class)); + String categoryName = dictService.getValue("post_category", post.getCategory()); + postVO.setCategoryName(categoryName); + return postVO; + } + +} diff --git a/blade-service/blade-user/pom.xml b/blade-service/blade-user/pom.xml index 033c67e..c603c1c 100644 --- a/blade-service/blade-user/pom.xml +++ b/blade-service/blade-user/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 2.6.2 + 2.7.0 4.0.0 @@ -31,6 +31,16 @@ blade-dict-api ${blade.project.version} + + org.springblade + blade-system-api + ${blade.project.version} + + + com.alibaba + easyexcel + ${easyexcel.version} + diff --git a/script/docker/.env b/script/docker/.env index 537b2c8..a622ba8 100644 --- a/script/docker/.env +++ b/script/docker/.env @@ -1,2 +1,2 @@ REGISTER=192.168.0.157/blade -TAG=2.6.2 +TAG=2.7.0