🎉 2.7.0.RELEASE,内核全面升级,增加岗位管理,用户导入导出

This commit is contained in:
smallchill 2020-04-24 18:02:14 +08:00
parent 942701ce01
commit 9cbe24872f
92 changed files with 1653 additions and 284 deletions

View File

@ -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.

View File

@ -1,9 +1,9 @@
<p align="center">
<img src="https://img.shields.io/badge/Release-V2.6.2-green.svg" alt="Downloads">
<img src="https://img.shields.io/badge/Release-V2.7.0-green.svg" alt="Downloads">
<img src="https://img.shields.io/badge/JDK-1.8+-green.svg" alt="Build Status">
<img src="https://img.shields.io/badge/license-Apache%202-blue.svg" alt="Build Status">
<img src="https://img.shields.io/badge/Spring%20Cloud-Hoxton.SR2-blue.svg" alt="Coverage Status">
<img src="https://img.shields.io/badge/Spring%20Boot-2.2.5.RELEASE-blue.svg" alt="Downloads">
<img src="https://img.shields.io/badge/Spring%20Cloud-Hoxton.SR3-blue.svg" alt="Coverage Status">
<img src="https://img.shields.io/badge/Spring%20Boot-2.2.6.RELEASE-blue.svg" alt="Downloads">
<a target="_blank" href="https://bladex.vip">
<img src="https://img.shields.io/badge/Author-Small%20Chill-ff69b4.svg" alt="Downloads">
</a>
@ -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开发手册)

View File

@ -8,7 +8,7 @@
<parent>
<artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<artifactId>blade-auth</artifactId>

View File

@ -81,6 +81,7 @@ public class AuthController {
}
@GetMapping("/captcha")
@ApiOperation(value = "获取验证码")
public R<Kv> captcha() {
SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5);
String verCode = specCaptcha.text().toLowerCase();

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -20,7 +20,7 @@ public interface CommonConstant {
/**
* 顶级父节点id
*/
Integer TOP_PARENT_ID = 0;
Long TOP_PARENT_ID = 0L;
/**
* 顶级父节点名称

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -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;
}

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>blade-ops</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>org.springblade</groupId>
<artifactId>blade-ops</artifactId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -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<Code> codes = codeService.listByIds(Func.toIntList(ids));
Collection<Code> codes = codeService.listByIds(Func.toLongList(ids));
codes.forEach(code -> {
BladeCodeGenerator generator = new BladeCodeGenerator();
// 设置数据源

View File

@ -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)));
}
/**

View File

@ -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;
/**
* 模块名称

View File

@ -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;
/**
* 名称

View File

@ -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

View File

@ -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

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>blade-ops</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>blade-ops</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>blade-ops</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>blade-service-api</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -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;
/**
* 标题

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>blade-service-api</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -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;
/**
* 标题

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>blade-service-api</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -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;
/**
* 字典码

View File

@ -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;
/**
* 子孙节点

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>blade-service-api</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -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

View File

@ -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;
/**
* 部门名

View File

@ -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;
/**
* 菜单编号

View File

@ -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;
/**
* 参数名

View File

@ -0,0 +1,77 @@
/**
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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;
}

View File

@ -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;
/**
* 角色名

View File

@ -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;
}

View File

@ -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

View File

@ -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<String> 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<String> 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<String> getRoleNames(@RequestParam("roleIds") String roleIds);
/**
* 获取角色别名
*
* @param id 主键
* @return 角色别名
*/
@GetMapping(API_PREFIX + "/getRoleAlias")
String getRoleAlias(@RequestParam("id") Long id);
}

View File

@ -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<String> getDeptNames(String deptIds) {
return null;
}
@Override
public Role getRole(Integer id) {
public String getPostIds(String tenantId, String postNames) {
return null;
}
@Override
public List<String> 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<String> getRoleNames(String roleIds) {
return null;
}
@Override
public String getRoleAlias(Long id) {
return null;
}
}

View File

@ -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;
/**
* 子孙节点

View File

@ -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;
/**
* 子孙节点

View File

@ -0,0 +1,39 @@
/**
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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;
}

View File

@ -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;
/**
* 子孙节点

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>blade-service-api</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -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;
}

View File

@ -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;
/**
* 性别
*/

View File

@ -5,13 +5,13 @@
<parent>
<artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>blade-service-api</artifactId>
<name>${project.artifactId}</name>
<version>2.6.2</version>
<version>2.7.0</version>
<packaging>pom</packaging>
<description>SpringBlade 微服务API集合</description>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>blade-service</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -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);
}

View File

@ -6,7 +6,7 @@
<parent>
<groupId>org.springblade</groupId>
<artifactId>blade-service</artifactId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -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);
}

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>blade-service</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>blade-service</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -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)));
}

View File

@ -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)));
}

View File

@ -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)));
}
/**

View File

@ -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)));
}
/**

View File

@ -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)));
}

View File

@ -0,0 +1,139 @@
/**
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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<PostVO> 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<IPage<PostVO>> list(Post post, Query query) {
IPage<Post> 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<IPage<PostVO>> page(PostVO post, Query query) {
IPage<PostVO> 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<List<Post>> select(String tenantId, BladeUser bladeUser) {
List<Post> list = postService.list(Wrappers.<Post>query().lambda().eq(Post::getTenantId, Func.toStr(tenantId, bladeUser.getTenantId())));
return R.data(list);
}
}

View File

@ -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);
}

View File

@ -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)));
}

View File

@ -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<String> getDeptNames(String deptIds) {
return deptService.getDeptNames(deptIds);
}
@Override
public String getPostIds(String tenantId, String postNames) {
return postService.getPostIds(tenantId, postNames);
}
@Override
public List<String> 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<String> getRoleNames(String roleIds) {
return roleService.getRoleNames(roleIds);
}
@Override
@GetMapping(API_PREFIX + "/getRoleAlias")
public String getRoleAlias(Long id) {
return roleService.getById(id).getRoleAlias();
}
}

View File

@ -46,4 +46,12 @@ public interface DeptMapper extends BaseMapper<Dept> {
*/
List<DeptVO> tree(String tenantId);
/**
* 获取部门名
*
* @param ids
* @return
*/
List<String> getDeptNames(Long[] ids);
}

View File

@ -38,4 +38,17 @@
</if>
</select>
<select id="getDeptNames" resultType="java.lang.String">
SELECT
dept_name
FROM
blade_dept
WHERE
id IN
<foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
#{ids}
</foreach>
and is_deleted = 0
</select>
</mapper>

View File

@ -59,7 +59,7 @@ public interface MenuMapper extends BaseMapper<Menu> {
* @param roleId
* @return
*/
List<MenuVO> grantTreeByRole(List<Integer> roleId);
List<MenuVO> grantTreeByRole(List<Long> roleId);
/**
* 所有菜单
@ -74,7 +74,7 @@ public interface MenuMapper extends BaseMapper<Menu> {
* @param roleId
* @return
*/
List<Menu> roleMenu(List<Integer> roleId);
List<Menu> roleMenu(List<Long> roleId);
/**
* 菜单树形结构
@ -82,7 +82,7 @@ public interface MenuMapper extends BaseMapper<Menu> {
* @param roleId
* @return
*/
List<Menu> routes(List<Integer> roleId);
List<Menu> routes(List<Long> roleId);
/**
* 按钮树形结构
@ -90,7 +90,7 @@ public interface MenuMapper extends BaseMapper<Menu> {
* @param roleId
* @return
*/
List<Menu> buttons(List<Integer> roleId);
List<Menu> buttons(List<Long> roleId);
/**
* 获取配置的角色权限
@ -98,5 +98,5 @@ public interface MenuMapper extends BaseMapper<Menu> {
* @param roleIds
* @return
*/
List<MenuDTO> authRoutes(List<Integer> roleIds);
List<MenuDTO> authRoutes(List<Long> roleIds);
}

View File

@ -0,0 +1,49 @@
/**
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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<Post> {
/**
* 自定义分页
*
* @param page
* @param post
* @return
*/
List<PostVO> selectPostPage(IPage page, PostVO post);
/**
* 获取岗位名
*
* @param ids
* @return
*/
List<String> getPostNames(Long[] ids);
}

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.system.mapper.PostMapper">
<!-- 通用查询映射结果 -->
<resultMap id="postResultMap" type="org.springblade.system.entity.Post">
<result column="id" property="id"/>
<result column="create_user" property="createUser"/>
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="category" property="category"/>
<result column="post_code" property="postCode"/>
<result column="post_name" property="postName"/>
<result column="sort" property="sort"/>
<result column="remark" property="remark"/>
</resultMap>
<select id="selectPostPage" resultMap="postResultMap">
select * from blade_post where is_deleted = 0
</select>
<select id="getPostNames" resultType="java.lang.String">
SELECT
post_name
FROM
blade_post
WHERE
id IN
<foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
#{ids}
</foreach>
and is_deleted = 0
</select>
</mapper>

View File

@ -47,4 +47,12 @@ public interface RoleMapper extends BaseMapper<Role> {
*/
List<RoleVO> tree(String tenantId, String excludeRole);
/**
* 获取角色名
*
* @param ids
* @return
*/
List<String> getRoleNames(Long[] ids);
}

View File

@ -40,4 +40,17 @@
</if>
</select>
<select id="getRoleNames" resultType="java.lang.String">
SELECT
role_name
FROM
blade_role
WHERE
id IN
<foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
#{ids}
</foreach>
and is_deleted = 0
</select>
</mapper>

View File

@ -46,4 +46,21 @@ public interface IDeptService extends IService<Dept> {
*/
List<DeptVO> tree(String tenantId);
/**
* 获取部门ID
*
* @param tenantId
* @param deptNames
* @return
*/
String getDeptIds(String tenantId, String deptNames);
/**
* 获取部门名
*
* @param deptIds
* @return
*/
List<String> getDeptNames(String deptIds);
}

View File

@ -0,0 +1,58 @@
/**
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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<Post> {
/**
* 自定义分页
*
* @param page
* @param post
* @return
*/
IPage<PostVO> selectPostPage(IPage<PostVO> page, PostVO post);
/**
* 获取岗位ID
*
* @param tenantId
* @param postNames
* @return
*/
String getPostIds(String tenantId, String postNames);
/**
* 获取岗位名
*
* @param postIds
* @return
*/
List<String> getPostNames(String postIds);
}

View File

@ -54,6 +54,23 @@ public interface IRoleService extends IService<Role> {
* @param menuIds 菜单id集合
* @return 是否成功
*/
boolean grant(@NotEmpty List<Integer> roleIds, @NotEmpty List<Integer> menuIds);
boolean grant(@NotEmpty List<Long> roleIds, @NotEmpty List<Long> menuIds);
/**
* 获取角色ID
*
* @param tenantId
* @param roleNames
* @return
*/
String getRoleIds(String tenantId, String roleNames);
/**
* 获取角色名
*
* @param roleIds
* @return
*/
List<String> getRoleNames(String roleIds);
}

View File

@ -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<DeptMapper, Dept> implements ID
return ForestNodeMerger.merge(baseMapper.tree(tenantId));
}
@Override
public String getDeptIds(String tenantId, String deptNames) {
List<Dept> deptList = baseMapper.selectList(Wrappers.<Dept>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<String> getDeptNames(String deptIds) {
return baseMapper.getDeptNames(Func.toLongArray(deptIds));
}
}

View File

@ -56,7 +56,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IM
@Override
public List<MenuVO> routes(String roleId) {
List<Menu> allMenus = baseMapper.allMenu();
List<Menu> roleMenus = baseMapper.roleMenu(Func.toIntList(roleId));
List<Menu> roleMenus = baseMapper.roleMenu(Func.toLongList(roleId));
List<Menu> 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<MenuMapper, Menu> implements IM
@Override
public List<MenuVO> buttons(String roleId) {
List<Menu> buttons = baseMapper.buttons(Func.toIntList(roleId));
List<Menu> buttons = baseMapper.buttons(Func.toLongList(roleId));
MenuWrapper menuWrapper = new MenuWrapper();
return menuWrapper.listNodeVO(buttons);
}
@ -87,12 +87,12 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IM
@Override
public List<MenuVO> 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<String> roleTreeKeys(String roleIds) {
List<RoleMenu> roleMenus = roleMenuService.list(Wrappers.<RoleMenu>query().lambda().in(RoleMenu::getRoleId, Func.toIntList(roleIds)));
List<RoleMenu> roleMenus = roleMenuService.list(Wrappers.<RoleMenu>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<MenuMapper, Menu> implements IM
if (Func.isEmpty(user)) {
return null;
}
List<MenuDTO> routes = baseMapper.authRoutes(Func.toIntList(user.getRoleId()));
List<MenuDTO> routes = baseMapper.authRoutes(Func.toLongList(user.getRoleId()));
List<Kv> list = new ArrayList<>();
routes.forEach(route -> list.add(Kv.init().set(route.getPath(), Kv.init().set("authority", Func.toStrArray(route.getAlias())))));
return list;

View File

@ -0,0 +1,58 @@
/**
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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<PostMapper, Post> implements IPostService {
@Override
public IPage<PostVO> selectPostPage(IPage<PostVO> page, PostVO post) {
return page.setRecords(baseMapper.selectPostPage(page, post));
}
@Override
public String getPostIds(String tenantId, String postNames) {
List<Post> postList = baseMapper.selectList(Wrappers.<Post>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<String> getPostNames(String postIds) {
return baseMapper.getPostNames(Func.toLongArray(postIds));
}
}

View File

@ -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<RoleMapper, Role> implements IR
}
@Override
public boolean grant(@NotEmpty List<Integer> roleIds, @NotEmpty List<Integer> menuIds) {
public boolean grant(@NotEmpty List<Long> roleIds, @NotEmpty List<Long> menuIds) {
// 删除角色配置的菜单集合
roleMenuService.remove(Wrappers.<RoleMenu>update().lambda().in(RoleMenu::getRoleId, roleIds));
// 组装配置
@ -80,4 +81,18 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IR
return roleMenuService.saveBatch(roleMenus);
}
@Override
public String getRoleIds(String tenantId, String roleNames) {
List<Role> roleList = baseMapper.selectList(Wrappers.<Role>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<String> getRoleNames(String roleIds) {
return baseMapper.getRoleNames(Func.toLongArray(roleIds));
}
}

View File

@ -64,7 +64,7 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> 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<TenantMapper, Tenant> 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);

View File

@ -0,0 +1,52 @@
/**
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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<Post, PostVO> {
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;
}
}

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>blade-service</artifactId>
<groupId>org.springblade</groupId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -31,6 +31,16 @@
<artifactId>blade-dict-api</artifactId>
<version>${blade.project.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-system-api</artifactId>
<version>${blade.project.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>${easyexcel.version}</version>
</dependency>
<!--Zipkin-->
<!--<dependency>
<groupId>org.springframework.cloud</groupId>

View File

@ -16,6 +16,8 @@
package org.springblade.system.user.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.read.builder.ExcelReaderBuilder;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@ -24,20 +26,33 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import org.apache.commons.codec.Charsets;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.SecureUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.excel.UserExcel;
import org.springblade.system.user.excel.UserImportListener;
import org.springblade.system.user.service.IUserService;
import org.springblade.system.user.vo.UserVO;
import org.springblade.system.user.wrapper.UserWrapper;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -118,7 +133,7 @@ public class UserController {
@ApiOperationSupport(order = 6)
@ApiOperation(value = "删除", notes = "传入地基和")
public R remove(@RequestParam String ids) {
return R.status(userService.deleteLogic(Func.toIntList(ids)));
return R.status(userService.deleteLogic(Func.toLongList(ids)));
}
@ -178,4 +193,69 @@ public class UserController {
return R.data(list);
}
/**
* 导入用户
*/
@PostMapping("import-user")
@ApiOperationSupport(order = 12)
@ApiOperation(value = "导入用户", notes = "传入excel")
public R importUser(MultipartFile file, Integer isCovered) {
String filename = file.getOriginalFilename();
if (StringUtils.isEmpty(filename)) {
throw new RuntimeException("请上传文件!");
}
if ((!StringUtils.endsWithIgnoreCase(filename, ".xls") && !StringUtils.endsWithIgnoreCase(filename, ".xlsx"))) {
throw new RuntimeException("请上传正确的excel文件!");
}
InputStream inputStream;
try {
UserImportListener importListener = new UserImportListener(userService);
inputStream = new BufferedInputStream(file.getInputStream());
ExcelReaderBuilder builder = EasyExcel.read(inputStream, UserExcel.class, importListener);
builder.doReadAll();
} catch (IOException e) {
e.printStackTrace();
}
return R.success("操作成功");
}
/**
* 导出用户
*/
@SneakyThrows
@GetMapping("export-user")
@ApiOperationSupport(order = 13)
@ApiOperation(value = "导出用户", notes = "传入user")
public void exportUser(@ApiIgnore @RequestParam Map<String, Object> user, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class);
if (!SecureUtil.isAdministrator()){
queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId());
}
queryWrapper.lambda().eq(User::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<UserExcel> list = userService.exportUser(queryWrapper);
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding(Charsets.UTF_8.name());
String fileName = URLEncoder.encode("用户数据导出", Charsets.UTF_8.name());
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), UserExcel.class).sheet("用户数据表").doWrite(list);
}
/**
* 导出模板
*/
@SneakyThrows
@GetMapping("export-template")
@ApiOperationSupport(order = 14)
@ApiOperation(value = "导出模板")
public void exportUser(HttpServletResponse response) {
List<UserExcel> list = new ArrayList<>();
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding(Charsets.UTF_8.name());
String fileName = URLEncoder.encode("用户数据模板", Charsets.UTF_8.name());
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), UserExcel.class).sheet("用户数据表").doWrite(list);
}
}

View File

@ -0,0 +1,89 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.system.user.excel;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* UserDTO
*
* @author Chill
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class UserExcel implements Serializable {
private static final long serialVersionUID = 1L;
@ColumnWidth(15)
@ExcelProperty("租户编号")
private String tenantId;
@ColumnWidth(15)
@ExcelProperty("账户")
private String account;
@ColumnWidth(10)
@ExcelProperty("昵称")
private String name;
@ColumnWidth(10)
@ExcelProperty("姓名")
private String realName;
@ExcelProperty("邮箱")
private String email;
@ColumnWidth(15)
@ExcelProperty("手机")
private String phone;
@ExcelIgnore
@ExcelProperty("角色ID")
private String roleId;
@ExcelIgnore
@ExcelProperty("部门ID")
private String deptId;
@ExcelIgnore
@ExcelProperty("岗位ID")
private String postId;
@ExcelProperty("角色名称")
private String roleName;
@ExcelProperty("部门名称")
private String deptName;
@ExcelProperty("岗位名称")
private String postName;
@ColumnWidth(20)
@ExcelProperty("生日")
private Date birthday;
}

View File

@ -0,0 +1,56 @@
package org.springblade.system.user.excel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import org.springblade.system.user.service.IUserService;
import java.util.ArrayList;
import java.util.List;
/**
* UserImportListener
*
* @author Chill
*/
@Data
@RequiredArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class UserImportListener extends AnalysisEventListener<UserExcel> {
/**
* 默认每隔3000条存储数据库
*/
private int batchCount = 3000;
/**
* 缓存的数据列表
*/
private List<UserExcel> list = new ArrayList<>();
/**
* 用户service
*/
private final IUserService userService;
@Override
public void invoke(UserExcel data, AnalysisContext context) {
list.add(data);
// 达到BATCH_COUNT则调用importer方法入库防止数据几万条数据在内存容易OOM
if (list.size() >= batchCount) {
// 调用importer方法
userService.importUser(list);
// 存储完成清理list
list.clear();
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
// 调用importer方法
userService.importUser(list);
// 存储完成清理list
list.clear();
}
}

View File

@ -15,9 +15,12 @@
*/
package org.springblade.system.user.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.excel.UserExcel;
import java.util.List;
@ -71,4 +74,12 @@ public interface UserMapper extends BaseMapper<User> {
*/
List<String> getDeptName(String[] ids);
/**
* 获取导出用户数据
*
* @param queryWrapper
* @return
*/
List<UserExcel> exportUser(@Param("ew") Wrapper<User> queryWrapper);
}

View File

@ -12,6 +12,7 @@
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="code" property="code"/>
<result column="account" property="account"/>
<result column="password" property="password"/>
<result column="name" property="name"/>
@ -88,4 +89,8 @@
and is_deleted = 0
</select>
<select id="exportUser" resultType="org.springblade.system.user.excel.UserExcel">
SELECT id, tenant_id, account, name, real_name, email, phone, birthday, role_id, dept_id, post_id FROM blade_user ${ew.customSqlSegment}
</select>
</mapper>

View File

@ -16,10 +16,12 @@
package org.springblade.system.user.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.entity.UserInfo;
import org.springblade.system.user.excel.UserExcel;
import java.util.List;
@ -91,7 +93,7 @@ public interface IUserService extends BaseService<User> {
* @param newPassword1
* @return
*/
boolean updatePassword(Integer userId, String oldPassword, String newPassword, String newPassword1);
boolean updatePassword(Long userId, String oldPassword, String newPassword, String newPassword1);
/**
* 获取角色名
@ -108,4 +110,20 @@ public interface IUserService extends BaseService<User> {
* @return
*/
List<String> getDeptName(String deptIds);
/**
* 导入用户数据
*
* @param data
* @return
*/
void importUser(List<UserExcel> data);
/**
* 获取导出用户数据
*
* @param queryWrapper
* @return
*/
List<UserExcel> exportUser(Wrapper<User> queryWrapper);
}

View File

@ -16,22 +16,25 @@
package org.springblade.system.user.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.exceptions.ApiException;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.CommonConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.DigestUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.*;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.entity.UserInfo;
import org.springblade.system.user.excel.UserExcel;
import org.springblade.system.user.mapper.UserMapper;
import org.springblade.system.user.service.IUserService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* 服务实现类
@ -39,8 +42,11 @@ import java.util.List;
* @author Chill
*/
@Service
@AllArgsConstructor
public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implements IUserService {
private ISysClient sysClient;
@Override
public boolean submit(User user) {
if (Func.isNotEmpty(user.getPassword())) {
@ -86,7 +92,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
public boolean grant(String userIds, String roleIds) {
User user = new User();
user.setRoleId(roleIds);
return this.update(user, Wrappers.<User>update().lambda().in(User::getId, Func.toIntList(userIds)));
return this.update(user, Wrappers.<User>update().lambda().in(User::getId, Func.toLongList(userIds)));
}
@Override
@ -94,11 +100,11 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
User user = new User();
user.setPassword(DigestUtil.encrypt(CommonConstant.DEFAULT_PASSWORD));
user.setUpdateTime(DateUtil.now());
return this.update(user, Wrappers.<User>update().lambda().in(User::getId, Func.toIntList(userIds)));
return this.update(user, Wrappers.<User>update().lambda().in(User::getId, Func.toLongList(userIds)));
}
@Override
public boolean updatePassword(Integer userId, String oldPassword, String newPassword, String newPassword1) {
public boolean updatePassword(Long userId, String oldPassword, String newPassword, String newPassword1) {
User user = getById(userId);
if (!newPassword.equals(newPassword1)) {
throw new ServiceException("请输入正确的确认密码!");
@ -119,4 +125,31 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
return baseMapper.getDeptName(Func.toStrArray(deptIds));
}
@Override
public void importUser(List<UserExcel> data) {
data.forEach(userExcel -> {
User user = Objects.requireNonNull(BeanUtil.copy(userExcel, User.class));
// 设置部门ID
user.setDeptId(sysClient.getDeptIds(userExcel.getTenantId(), userExcel.getDeptName()));
// 设置岗位ID
user.setPostId(sysClient.getPostIds(userExcel.getTenantId(), userExcel.getPostName()));
// 设置角色ID
user.setRoleId(sysClient.getRoleIds(userExcel.getTenantId(), userExcel.getRoleName()));
// 设置默认密码
user.setPassword(DigestUtil.encrypt(CommonConstant.DEFAULT_PASSWORD));
this.submit(user);
});
}
@Override
public List<UserExcel> exportUser(Wrapper<User> queryWrapper) {
List<UserExcel> userList = baseMapper.exportUser(queryWrapper);
userList.forEach(user -> {
user.setRoleName(StringUtil.join(sysClient.getRoleNames(user.getRoleId())));
user.setDeptName(StringUtil.join(sysClient.getDeptNames(user.getDeptId())));
user.setPostName(StringUtil.join(sysClient.getPostNames(user.getPostId())));
});
return userList;
}
}

View File

@ -7,12 +7,12 @@
<parent>
<groupId>org.springblade</groupId>
<artifactId>SpringBlade</artifactId>
<version>2.6.2</version>
<version>2.7.0</version>
</parent>
<artifactId>blade-service</artifactId>
<name>${project.artifactId}</name>
<version>2.6.2</version>
<version>2.7.0</version>
<packaging>pom</packaging>
<description>SpringBlade 微服务集合</description>

View File

@ -12,6 +12,9 @@ server:
#spring配置
spring:
cloud:
sentinel:
eager: true
devtools:
restart:
log-condition-evaluation-delta: false
@ -22,8 +25,6 @@ spring:
feign:
hystrix:
enabled: true
#sentinel:
#enabled: true
okhttp:
enabled: true
httpclient:
@ -69,7 +70,7 @@ management:
#blade配置
blade:
xss:
enable: true
enabled: true
skip-url:
- /weixin
secure:

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,175 @@
-- ----------------------------
-- 修改表主键为long类型
-- ----------------------------
ALTER TABLE `blade_notice`
MODIFY COLUMN `id` bigint(64) NOT NULL COMMENT '主键' FIRST,
MODIFY COLUMN `create_user` bigint(64) NULL DEFAULT NULL COMMENT '创建人' AFTER `content`,
MODIFY COLUMN `update_user` bigint(64) NULL DEFAULT NULL COMMENT '修改人' AFTER `create_time`;
ALTER TABLE `blade_client`
MODIFY COLUMN `id` bigint(64) NOT NULL COMMENT '主键' FIRST,
MODIFY COLUMN `create_user` bigint(64) NULL DEFAULT NULL COMMENT '创建人' AFTER `autoapprove`,
MODIFY COLUMN `update_user` bigint(64) NULL DEFAULT NULL COMMENT '修改人' AFTER `create_time`;
ALTER TABLE `blade_code`
MODIFY COLUMN `id` bigint(64) NOT NULL COMMENT '主键' FIRST;
ALTER TABLE `blade_datasource`
MODIFY COLUMN `id` bigint(64) NOT NULL COMMENT '主键' FIRST;
ALTER TABLE `blade_dept`
MODIFY COLUMN `id` bigint(64) NOT NULL COMMENT '主键' FIRST,
MODIFY COLUMN `parent_id` bigint(64) NULL DEFAULT 0 COMMENT '父主键' AFTER `tenant_id`;
ALTER TABLE `blade_dict`
MODIFY COLUMN `id` bigint(64) NOT NULL COMMENT '主键' FIRST,
MODIFY COLUMN `parent_id` bigint(64) NULL DEFAULT 0 COMMENT '父主键' AFTER `id`;
ALTER TABLE `blade_menu`
MODIFY COLUMN `id` bigint(64) NOT NULL COMMENT '主键' FIRST,
MODIFY COLUMN `parent_id` bigint(64) NULL DEFAULT 0 COMMENT '父级菜单' AFTER `id`;
ALTER TABLE `blade_param`
MODIFY COLUMN `id` bigint(64) NOT NULL COMMENT '主键' FIRST,
MODIFY COLUMN `create_user` bigint(64) NULL DEFAULT NULL COMMENT '创建人' AFTER `remark`,
MODIFY COLUMN `update_user` bigint(64) NULL DEFAULT NULL COMMENT '修改人' AFTER `create_time`;
ALTER TABLE `blade_role`
MODIFY COLUMN `id` bigint(64) NOT NULL COMMENT '主键' FIRST,
MODIFY COLUMN `parent_id` bigint(64) NULL DEFAULT 0 COMMENT '父主键' AFTER `tenant_id`;
ALTER TABLE `blade_role_menu`
MODIFY COLUMN `id` bigint(64) NOT NULL COMMENT '主键' FIRST,
MODIFY COLUMN `menu_id` bigint(64) NULL DEFAULT NULL COMMENT '菜单id' AFTER `id`,
MODIFY COLUMN `role_id` bigint(64) NULL DEFAULT NULL COMMENT '角色id' AFTER `menu_id`;
ALTER TABLE `blade_tenant`
MODIFY COLUMN `id` bigint(64) NOT NULL COMMENT '主键' FIRST,
MODIFY COLUMN `create_user` bigint(64) NULL DEFAULT NULL COMMENT '创建人' AFTER `address`,
MODIFY COLUMN `update_user` bigint(64) NULL DEFAULT NULL COMMENT '修改人' AFTER `create_time`;
ALTER TABLE `blade_user`
MODIFY COLUMN `id` bigint(64) NOT NULL COMMENT '主键' FIRST,
MODIFY COLUMN `role_id` bigint(64) NULL DEFAULT NULL COMMENT '角色id' AFTER `sex`,
MODIFY COLUMN `dept_id` bigint(64) NULL DEFAULT NULL COMMENT '部门id' AFTER `role_id`,
MODIFY COLUMN `create_user` bigint(64) NULL DEFAULT NULL COMMENT '创建人' AFTER `dept_id`,
MODIFY COLUMN `update_user` bigint(64) NULL DEFAULT NULL COMMENT '修改人' AFTER `create_time`;
-- ----------------------------
-- 删除多余字段
-- ----------------------------
ALTER TABLE `blade_datasource`
DROP COLUMN `create_dept`;
-- ----------------------------
-- 修改表字段为雪花id
-- ----------------------------
update `blade_client` set id = id + 1123598811738675200;
update `blade_code` set id = id + 1123598812738675200, datasource_id = datasource_id + 1123598812738675200;
update `blade_datasource` set id = id + 1123598812738675200;
update `blade_dept` set id = id + 1123598813738675200;
update `blade_dept` set parent_id = parent_id + 1123598813738675200 where parent_id > 0;
update `blade_dict` set id = id + 1123598814738675200;
update `blade_dict` set parent_id = parent_id + 1123598814738675200 where parent_id > 0;
update `blade_menu` set id = id + 1123598815738675200;
update `blade_menu` set parent_id = parent_id + 1123598815738675200 where parent_id > 0;
update `blade_role` set id = id + 1123598816738675200;
update `blade_role` set parent_id = parent_id + 1123598816738675200 where parent_id > 0;
update `blade_role_menu` set id = id + 1123598817738675200;
update `blade_role_menu` set menu_id = menu_id + 1123598815738675200;
update `blade_role_menu` set role_id = role_id + 1123598816738675200;
update `blade_notice` set id = id + 1123598818738675200, create_user = create_user + 1123598821738675200, update_user = update_user + 1123598821738675200;
update `blade_param` set id = id + 1123598819738675200, create_user = create_user + 1123598821738675200, update_user = update_user + 1123598821738675200;
update `blade_tenant` set id = id + 1123598820738675200, create_user = create_user + 1123598821738675200, update_user = update_user + 1123598821738675200;
update `blade_user` set id = id + 1123598821738675200, role_id = role_id + 1123598816738675200, dept_id = dept_id + 1123598813738675200, create_user = create_user + 1123598821738675200, update_user = update_user + 1123598821738675200;
-- ----------------------------
-- 将user表字段再改回varchar
-- ----------------------------
ALTER TABLE `blade_user`
MODIFY COLUMN `role_id` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色id' AFTER `sex`,
MODIFY COLUMN `dept_id` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门id' AFTER `role_id`;
-- ----------------------------
-- 增加用户表字段
-- ----------------------------
ALTER TABLE `blade_user`
ADD COLUMN `code` varchar(12) NULL COMMENT '用户编号' AFTER `tenant_id`,
ADD COLUMN `post_id` varchar(1000) NULL COMMENT '岗位id' AFTER `dept_id`;
update `blade_user` set post_id = 1123598817738675201 where id = 1123598821738675201;
-- ----------------------------
-- 增加岗位管理表
-- ----------------------------
CREATE TABLE `blade_post` (
`id` bigint(64) NOT NULL COMMENT '主键',
`tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`category` int(11) NULL DEFAULT NULL COMMENT '岗位类型',
`post_code` varchar(12) NULL COMMENT '岗位编号',
`post_name` varchar(64) NULL COMMENT '岗位名称',
`sort` int(2) NULL COMMENT '岗位排序',
`remark` varchar(255) NULL COMMENT '岗位描述',
`create_user` bigint(64) NULL DEFAULT NULL COMMENT '创建人',
`create_dept` bigint(64) NULL DEFAULT NULL COMMENT '创建部门',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_user` bigint(64) NULL DEFAULT NULL COMMENT '修改人',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`status` int(2) NULL DEFAULT NULL COMMENT '状态',
`is_deleted` int(2) NULL DEFAULT NULL COMMENT '是否已删除',
PRIMARY KEY (`id`)
) COMMENT = '岗位表';
-- ----------------------------
-- 增加岗位管理表数据
-- ----------------------------
INSERT INTO `blade_post`(`id`, `tenant_id`, `category`, `post_code`, `post_name`, `sort`, `remark`, `create_user`, `create_dept`, `create_time`, `update_user`, `update_time`, `status`, `is_deleted`)
VALUES (1123598817738675201, '000000', 1, 'ceo', '首席执行官', 1, '总经理', 1123598821738675201, 1123598813738675201, '2020-04-01 00:00:00', 1123598821738675201, '2020-04-01 00:00:00', 1, 0);
INSERT INTO `blade_post`(`id`, `tenant_id`, `category`, `post_code`, `post_name`, `sort`, `remark`, `create_user`, `create_dept`, `create_time`, `update_user`, `update_time`, `status`, `is_deleted`)
VALUES (1123598817738675202, '000000', 1, 'coo', '首席运营官', 2, '常务总经理', 1123598821738675201, 1123598813738675201, '2020-04-01 00:00:00', 1123598821738675201, '2020-04-01 00:00:00', 1, 0);
INSERT INTO `blade_post`(`id`, `tenant_id`, `category`, `post_code`, `post_name`, `sort`, `remark`, `create_user`, `create_dept`, `create_time`, `update_user`, `update_time`, `status`, `is_deleted`)
VALUES (1123598817738675203, '000000', 1, 'cfo', '首席财务官', 3, '财务总经理', 1123598821738675201, 1123598813738675201, '2020-04-01 00:00:00', 1123598821738675201, '2020-04-01 00:00:00', 1, 0);
INSERT INTO `blade_post`(`id`, `tenant_id`, `category`, `post_code`, `post_name`, `sort`, `remark`, `create_user`, `create_dept`, `create_time`, `update_user`, `update_time`, `status`, `is_deleted`)
VALUES (1123598817738675204, '000000', 1, 'cto', '首席技术官', 4, '技术总监', 1123598821738675201, 1123598813738675201, '2020-04-01 00:00:00', 1123598821738675201, '2020-04-01 00:00:00', 1, 0);
INSERT INTO `blade_post`(`id`, `tenant_id`, `category`, `post_code`, `post_name`, `sort`, `remark`, `create_user`, `create_dept`, `create_time`, `update_user`, `update_time`, `status`, `is_deleted`)
VALUES (1123598817738675205, '000000', 1, 'cio', '首席信息官', 5, '信息总监', 1123598821738675201, 1123598813738675201, '2020-04-01 00:00:00', 1123598821738675201, '2020-04-01 00:00:00', 1, 0);
INSERT INTO `blade_post`(`id`, `tenant_id`, `category`, `post_code`, `post_name`, `sort`, `remark`, `create_user`, `create_dept`, `create_time`, `update_user`, `update_time`, `status`, `is_deleted`)
VALUES (1123598817738675206, '000000', 2, 'pm', '技术经理', 6, '研发和产品是永远的朋友', 1123598821738675201, 1123598813738675201, '2020-04-01 00:00:00', 1123598821738675201, '2020-04-01 00:00:00', 1, 0);
INSERT INTO `blade_post`(`id`, `tenant_id`, `category`, `post_code`, `post_name`, `sort`, `remark`, `create_user`, `create_dept`, `create_time`, `update_user`, `update_time`, `status`, `is_deleted`)
VALUES (1123598817738675207, '000000', 2, 'hrm', '人力经理', 7, '人力资源部门工作管理者', 1123598821738675201, 1123598813738675201, '2020-04-01 00:00:00', 1123598821738675201, '2020-04-01 00:00:00', 1, 0);
INSERT INTO `blade_post`(`id`, `tenant_id`, `category`, `post_code`, `post_name`, `sort`, `remark`, `create_user`, `create_dept`, `create_time`, `update_user`, `update_time`, `status`, `is_deleted`)
VALUES (1123598817738675208, '000000', 3, 'staff', '普通员工', 8, '普通员工', 1123598821738675201, 1123598813738675201, '2020-04-01 00:00:00', 1123598821738675201, '2020-04-01 00:00:00', 1, 0);
-- ----------------------------
-- 增加岗位管理菜单数据
-- ----------------------------
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1164733389668962251', '1123598815738675203', 'post', '岗位管理', 'menu', '/system/post', 'iconfont iconicon_message', 2, 1, 0, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1164733389668962252', '1164733389668962251', 'post_add', '新增', 'add', '/system/post/add', 'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1164733389668962253', '1164733389668962251', 'post_edit', '修改', 'edit', '/system/post/edit', 'form', 2, 2, 2, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1164733389668962254', '1164733389668962251', 'post_delete', '删除', 'delete', '/api/blade-system/post/remove', 'delete', 3, 2, 3, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1164733389668962255', '1164733389668962251', 'post_view', '查看', 'view', '/system/post/view', 'file-text', 4, 2, 2, 1, NULL, 0);
-- ----------------------------
-- 增加岗位管理菜单权限数据
-- ----------------------------
INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`)
VALUES ('1161272893875225001', '1164733389668962251', '1123598816738675201');
INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`)
VALUES ('1161272893875225002', '1164733389668962252', '1123598816738675201');
INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`)
VALUES ('1161272893875225003', '1164733389668962253', '1123598816738675201');
INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`)
VALUES ('1161272893875225004', '1164733389668962254', '1123598816738675201');
INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`)
VALUES ('1161272893875225005', '1164733389668962255', '1123598816738675201');
INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`)
VALUES ('1161272893875225006', '1164733389668962256', '1123598816738675201');
-- ----------------------------
-- 增加岗位类型字典数据
-- ----------------------------
INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`)
VALUES (1123598814738777220, 0, 'post_category', '-1', '岗位类型', 12, NULL, 0);
INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`)
VALUES (1123598814738777221, 1123598814738777220, 'post_category', '1', '高层', 1, NULL, 0);
INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`)
VALUES (1123598814738777222, 1123598814738777220, 'post_category', '2', '中层', 2, NULL, 0);
INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`)
VALUES (1123598814738777223, 1123598814738777220, 'post_category', '3', '基层', 3, NULL, 0);
INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`)
VALUES (1123598814738777224, 1123598814738777220, 'post_category', '4', '其他', 4, NULL, 0);

15
pom.xml
View File

@ -5,27 +5,28 @@
<groupId>org.springblade</groupId>
<artifactId>SpringBlade</artifactId>
<version>2.6.2</version>
<version>2.7.0</version>
<packaging>pom</packaging>
<properties>
<blade.tool.version>2.6.2</blade.tool.version>
<blade.project.version>2.6.2</blade.project.version>
<blade.tool.version>2.7.0</blade.tool.version>
<blade.project.version>2.7.0</blade.project.version>
<java.version>1.8</java.version>
<maven.plugin.version>3.8.1</maven.plugin.version>
<swagger.version>2.9.2</swagger.version>
<swagger.models.version>1.5.21</swagger.models.version>
<knife4j.version>2.0.1</knife4j.version>
<knife4j.version>2.0.2</knife4j.version>
<mybatis.plus.version>3.3.1</mybatis.plus.version>
<protostuff.version>1.6.0</protostuff.version>
<captcha.version>1.6.2</captcha.version>
<easyexcel.version>2.1.6</easyexcel.version>
<mica.auto.version>1.1.0</mica.auto.version>
<alibaba.cloud.version>2.2.0.RELEASE</alibaba.cloud.version>
<alibaba.cloud.version>2.2.1.RELEASE</alibaba.cloud.version>
<spring.boot.admin.version>2.2.2</spring.boot.admin.version>
<spring.boot.version>2.2.5.RELEASE</spring.boot.version>
<spring.cloud.version>Hoxton.SR2</spring.cloud.version>
<spring.boot.version>2.2.6.RELEASE</spring.boot.version>
<spring.cloud.version>Hoxton.SR3</spring.cloud.version>
<spring.platform.version>Cairo-SR8</spring.platform.version>
<!-- 推荐使用Harbor -->

View File

@ -1,2 +1,2 @@
REGISTER=192.168.0.157/blade
TAG=2.6.2
TAG=2.7.0